Click here to Skip to main content
15,065,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why to use Right Join when there is Left Join i mean if i need to view data from left table i always place the table on the left of the join then why the right join is introduced?
Posted

   
Comments
Maciej Los 5-Apr-13 8:37am
   
+5!
fawadparacha 5-Apr-13 11:00am
   
thanks for your reply

but i just want to know the reason why Right Join is introduced when there is Left Join present, what is the logic between placing the table to left or right of the join, is there any difference when to use left and when to use right joins?

Actually an interviewer asked me this question so since then i am looking for its answer
Shanalal Kasim 12-Apr-13 3:17am
   
+5
Think of this example:
SQL
SELECT  *
FROM    LeftTable
RIGHT JOIN MiddleTable USING SomeID
LEFT JOIN RightTable USING SomeOtherID

It could be done using to left joins, but it's easier to understand this way
So the answer is clarity.
   
You can check this one, wish it would be help full regarding joining.
Differences Between Various Joins in MS SQL Server[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900