Hi, Can anyone tell me the actual difference between these queries? SELECT * FROM Table1 AS A, Table2 AS B WHERE A.Field1 = B.Field1 SELECT * FROM Table1 AS A INNER JOIN Table2 AS B ON A.Field1 = B.Field1 Which query is efficient.? Please tell me, I bet with my friend the INNER JOIN query is faster and efficient than the first one. Thanks in advance Ganesh.
Check out the execution plans: they should be identical. If the execution plans are identical, the queries are identical. In general, you should use JOINs for joining tables, and the WHERE clause for filtering results.
As Adriaan already said, there is no difference between both as long as you're only using INNER JOINs. The optimizer is smart enough to figure that out and will rewrite your query to use an inner join behind the scenes anyway. However, you might want to check this out: http://www.sqlskills.com/blogs/conor/2008/03/29/ONVsWHEREWhereShouldYouPutJoinConditions.aspx