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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
SenthilkumarRank #387 · 6.5K reputationPosted Apr 9, 2012, 10:51 PM EDT
The condition usage in the "on" will improve the performance of the query result.
MuthuMari MRank #5,738 · 288 reputationPosted Apr 9, 2012, 11:24 PM EDT
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"