Left join and Right join works same but why do we have both?
We have left join and right join in sql server and both works in same way in logical. But why we have both join vailable.? What is the difference in parsing these two joins.? In which case we will prefer right join?When it slow down the query? I expect an excellent way of reply.. Thanking you in anticipation..
Left and right joins are functionally equivalent. There is no difference between them beyond a difference in the application of the syntax. On a right join, all values from the right table are returned and only those values that match on the left. In a left join, all values from the left table are returned and only those values that match on the right. They are just two constructs of the same idea to allow you to logically write your code in a way that makes more sense to you in a given situation. Also, it allows you to quickly modify behavior without having to rearrange your T-SQL code. There is no reason to prefer one over the other. Neither will slow the query or speed the query more than the other.