Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

We have joins in SQL.Its possible that we can do all our join logic with Left join(We can interchange the tables when there is a need of right join).
So can anyone help me out that why do we need a right join when all our work can be done by using a left join.

Thanks
Posted
Updated 10-Jun-22 4:59am

I think you'll find this discussion interesting and it may answer your question as well.
http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/[^]
 
Share this answer
 
if you are using join in sql and join three tables in single query and with 2 tables using left join and you want all records of third table then you can't use left join with 3rd table, so you have to use right join with 3rd table.
 
Share this answer
 
Suppose you have 3 table and as a output you need all the data from middle table and matching data from outer table that time it will not work to use left table.
 
Share this answer
 
Comments
RedDk 10-Jun-22 11:48am    
THe last time this poster was active on this site was in 2016. This is a question from 2012. Adding the fact that it's an old post is only the fender of the steamroller: it has no code to substantiate any validity of meaning to cpians, and is so vague as to be basic documentary recrudescence.

Today it's 2022. And that is why I'm downvoting this Answer.

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