Reply To: SQL for Dummies – Dataload Customer bis Organization_Type

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

#2809
Stefan Reichelt
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'