Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Outer Join for 2 Tables?

Former Member
0 Likes
573

Hi,

i have 3 Tables, one is the "main" table.

Table1

-


Col1

Col2

Col3

Table2

-


Col2

Col4

Col5

Table3

-


Col4

Col6

Now i want all hits from Table 1, all outer join hits from table 2 and the regarding rows from table 3.

The join from Table1 to Table2 is no problem, but how to add table3?

SELECT *

FROM table1 AS t1

LEFT OUTER JOIN table2 AS t2

ON t2col2 = t1col2

INTO CORRESPONDING FIELDS OF TABLE result

WHERE t1~col1 IN so_col1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
540

Hi,

a right table in an outer join cannot become a part of an inner join or an outer join. So you will have to use some other technique.

meaing table1 connects to table2 with an outer join resulting in all rows table1 and cooresponding if existing from table2, now table2 is the right table it cannot make a join with table3. inner or outer.

regards,

Khusro Habib

4 REPLIES 4
Read only

Former Member
0 Likes
540

Please have a look at below link. Not sure but might be useful for you.

[Left Outer Join|http://help.sap.com/saphelp_erp2004/helpdata/en/67/7e4b3eaf72561ee10000000a114084/frameset.htm]

Read only

Former Member
0 Likes
541

Hi,

a right table in an outer join cannot become a part of an inner join or an outer join. So you will have to use some other technique.

meaing table1 connects to table2 with an outer join resulting in all rows table1 and cooresponding if existing from table2, now table2 is the right table it cannot make a join with table3. inner or outer.

regards,

Khusro Habib

Read only

0 Likes
540

Ok thanks,

means that i have to make an intermediate step

Read only

0 Likes
540

reward points and close the issue....