SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists

Posted by pinaldave on SQL Authority See other posts from SQL Authority or by pinaldave
Published on Sun, 28 Nov 2010 01:30:31 +0000 Indexed on 2010/12/06 16:57 UTC
Read the original article Hit count: 878

I had interesting conversation with the attendees of the my SQL Server Performance Tuning course.

I was asked if LEFT JOIN can do the same task as RIGHT JOIN by reserving the order of the tables in join, why does RIGHT JOIN exists?

The definitions are as following:
Left Join – select all the records from the LEFT table and then pick up any matching records from the RIGHT table  

Right Join – select all the records from the RIGHT table and then pick up any matching records from the LEFT table

Most of us read from LEFT to RIGHT so we are using LEFT join. Do you have any explaination why RIGHT JOIN exists or can you come up with example, where RIGHT JOIN is absolutely required and the task can not be achieved with LEFT JOIN.

Other Puzzles:

SQL SERVER – Puzzle – Challenge – Error While Converting Money to Decimal

SQL SERVER – Challenge – Puzzle – Usage of FAST Hint

Reference: Pinal Dave (http://blog.sqlauthority.com)


Filed under: Pinal Dave, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

© SQL Authority or respective owner

Related posts about Pinal Dave

Related posts about sql