1.

What Is Right Outer Join?

Answer»

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

Example: To display Bonus irrespective of whether they are an employee or not.

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

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

Example: To display Bonus irrespective of whether they are an employee or not.

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



Discussion

No Comment Found