Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

check condition before join or check condition after join in sql server?

$
0
0

Please light me which has better performance in this 2 queries..........

And how can I know it ? (for eg, In query execution plan)

SELECT * FROM order o RIGHT JOIN customer c on o.customerId = c.customerId

WHERE c.city = 'NewYork' 

--------------------------------------------------------------------------------------------------------------------

SELECT * FROM order o RIGHT JOIN (SELECT * FROM customer c WHERE city = 'NewYork') AS c

on o.customerId =  c.customerId


Viewing all articles
Browse latest Browse all 4871

Trending Articles