List:MaxDB« Previous MessageNext Message »
From:Marco Keuthen Date:March 6 2002 10:04am
Subject:Question: LEFT OUTER JOIN on 3+ tables
View as plain text  
Hi,
perhaps someone could give me a clue :-)
I have three tables:
SELECT
T1.Field1,
T2.Field2,
T2.Field2,
T3.Field2,
They have a 3er key.
T1.Field2 is the foreign key for T2.Field1,
T2.Field2 is the foreign key for T3Field1
If I do:
SELECT
T1.Field1,
T2.Field3,
T3.Field3
FROM
T1 LEFT OUTER JOIN T2 ON (T1.Field2 = T2.Field1) LEFT OUTER JOIN (T2.Field2
= T3.Field1)
...
I get an error. (Invalid end of SQL...)
How do I handle a chained dependency in SAPDB?
I want all the records in T1, even if T2 or T3 hasn't a correct value, so
SELECT
T1.Field1,
T2.Field3,
T3.Field3
FROM
T1,
T2,
T3
WHERE
T2.Field1 = T1.Field2 AND T3.Field1 = T2.Field2
wouldnt do the job.
Any ideas?
Thanks,
Marco





Attachment: [text/html]
Attachment: [text/html]
Thread
Question: LEFT OUTER JOIN on 3+ tablesMarco Keuthen6 Mar
RE: Question: LEFT OUTER JOIN on 3+ tablesHolger Becker6 Mar