March 31, 2006 at 12:56 pm
Hi,
I have a question relating to the performance of the query. which one will run faster in the following queries. If so, why?
SELECT A.productid, B.productdescription
FROM table A JOIN table B
ON A.productid = B.productid AND B.Active = 1
or
SELECT A.productid, B.productdescription
FROM table A JOIN table B
ON A.productid = B.productid
where B.Active = 1
Thanks,
Sridhar.
March 31, 2006 at 1:06 pm
they are the same. ON just gets higher precedence.
March 31, 2006 at 1:09 pm
There is a whole tread dedicated on this topic on http://www.sql-server-performance.com
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=11585
March 31, 2006 at 1:13 pm
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=11585
Comments posted by Frank Kalis on the order of execution of the FROM and WHERE clause gives insite into the query execution process.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply