Is it possible to put one left outer join into another left outer join

Can I put a left outer join inside another outer outer join? Like this:

SELECT * FROM table1 LEFT OUTER JOIN table2 ON (LEFT OUTER JOIN table 3 ON (Join Conditions)) WHERE ....(where conditions) 
+6
source share
1 answer

To group multiple connections, the syntax is as follows (untested on db2)

 SELECT * FROM table1 t1 LEFT JOIN ( table2 t2 INNER JOIN table3 t3 ON t3.someId = t2.someId ) ON t2.someId = t1.someId 

Same syntax for left join inside LEFT JOIN() , but please read @ X-Zero's comment

 SELECT * FROM table1 t1 LEFT JOIN ( table2 t2 LEFT JOIN table3 t3 ON t3.someId = t2.someId ) ON t2.someId = t1.someId 
+11
source

Source: https://habr.com/ru/post/914626/


All Articles