What Is The Use Of Right Join Exactly As We Can Get The Same Result From Left Join
I want to know that what is the use of right join exactly as we can get the same result from left join by interchanging the tables. So let's take an example here - Suppose i need t
Solution 1:
Suppose you need to do a double join like this:
SELECT*FROM table1
LEFTJOIN table2 ON table1.name = table2.name1
RIGHTJOIN table3 ON table2.position = table3.job;
that is when the RIGHT JOIN is useful...
Regards
Solution 2:
In case of only tow table you can switch the tables to get the same result from right and left join. But if you are having more than two table and you need to put left join on few tables right join on few tables so in that case you need both the joins.
Solution 3:
As stated in http://dev.mysql.com/doc/refman/5.7/en/outer-join-simplification.html
At the parser stage, queries with right outer joins operations are converted to equivalent queries containing only left join operations.
Using RIGHT JOIN will cause parser conversions, but it should be negligible in pracitce.
Post a Comment for "What Is The Use Of Right Join Exactly As We Can Get The Same Result From Left Join"