Welcome to the POB User Group Online Community! › Forums › PUG DACH › SQL for Dummies – Dataload Customer bis Organization_Type › Reply To: SQL for Dummies – Dataload Customer bis Organization_Type
21/05/2015 at 10:40
#2809
Participant
Ach ja, deine letzte Frage hatte ich überlesen: Natürlich kannst du den Filter auf “Intern” in den Where-Bereich verlagern.
SELECT cus.customer_pk as Kontakt
, org.id as Organisation
, ot.Organization_Type_PK as OTyp
, ot.id as OTypId
FROM Customer cus
INNER JOIN Organization org ON cus.organization_pk = org.organization_pk
INNER JOIN Organization_Type ot ON org.Organization_Type_PK = ot.Organization_Type_PK
WHERE
isnull(cus.Virtual_Bereichsleiterkennzeichen,0)=0
and
ot.Id='Intern'