1.

What Is Left Outer Join?

Answer»

A left OUTER join or a left join returns results from the table mentioned on the left of the join IRRESPECTIVE of whether it finds matches or not. If the ON clause matches 0 records from table on the right, it will still return a ROW in the result—but with NULL in each column.

Example: To DISPLAY employees irrespective of whether they have got bonus.

Select * from employee LEFT OUTER JOIN bonus ON employee.bonus=bonus.bonus

A left outer join or a left join returns results from the table mentioned on the left of the join irrespective of whether it finds matches or not. If the ON clause matches 0 records from table on the right, it will still return a row in the result—but with NULL in each column.

Example: To display employees irrespective of whether they have got bonus.

Select * from employee LEFT OUTER JOIN bonus ON employee.bonus=bonus.bonus



Discussion

No Comment Found