Answers for "sql left outer join vs left join"

SQL
15

sql left outer join vs left join

-- LEFT OUTER JOIN is equivalent to LEFT JOIN
-- b.VALUE1 is null when ID not in table2 (idem for c.VALUE1 in table3)
SELECT a.ID, a.NAME, b.VALUE1, c.VALUE1 FROM table1 a 
  LEFT OUTER JOIN table2 b ON a.ID = b.ID
  LEFT OUTER JOIN table3 c ON a.ID = c.ID
WHERE a.ID >= 1000;

-- ⇓ Test it ⇓ (Fiddle source link)
Posted by: Guest on July-08-2021
0

right outer vs left outer join

LEFT OUTER JOIN:
is used when retrieving data from
multiple tables and will return
left table and any matching right table records.

RIGHT OUTER JOIN:
is used when retrieving data from
multiple tables and will return right
table and any matching left table records
Posted by: Guest on January-07-2021

Code answers related to "sql left outer join vs left join"

Code answers related to "SQL"

Browse Popular Code Answers by Language