Difference between using condition in where clause and on in joins in sql server?
what is the difference between using condition in where clause and on in joins in sql server?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Apr 10, 2012, 2:51 AM
The condition usage in the "on" will improve the performance of the query result.
MuthuMari MPosted Apr 10, 2012, 3:24 AM
ON clauses of a SQL statement will create a faster query when compared to the same SELECT statement if the same criteria was placed in the WHERE clause. The ON clause is executed before the WHERE clause so I figured criteria there would perform better. When you join two tables together it creates a cross-product then it applies the WHERE clause to the resultant table join.
pls refer this url for more info :
http://www.bennadel.com/blog/284-SQL-Optimization-And-ON-Clause-vs-WHERE-Clause.htm
thanks.
If this post is useful then mark it as "Accepted Answer"