If you are talking about results, there will not be many differences . If you talk about performance, the SQL Server engine is much smarter and will automatically rewrite your search in most cases, so will not have differences in performance . That said, I prefer you to use INNER JOIN
when a query involves more than one table, since it is the valid syntax of ANSI
.
If you're ever going to use OUTER JOIN
, the question of JOIN
vs WHERE
does not make any sense, since the answer may be different in most cases.
See an example:
Assuming we have these two tables.
-- JOIN
SELECT s.SalesRep, o.Amount
FROM SalesRep s
INNER JOIN Orders o ON s.id = o.id
GO
-- WHERE
SELECT s.SalesRep, o.Amount
FROM SalesRep s, Orders o
WHERE s.id = o.id
GO
You will notice in the result set that both queries return exactly the same result. As I mentioned earlier when we use the clause INNER JOIN
and WHERE
, there is no impact of the result if the condition JOIN
and clause WHERE
have almost the same condition.
Let's see a quick example in which the external combination provides absolutely different results compared to the cases in which there is a totally different commercial logic when the external combination has to be used. As I mentioned earlier, it's like comparing apples and oranges if you compare the outer union and the where clause. They are not the same logically.
-- JOIN
SELECT s.SalesRep, o.Amount
FROM SalesRep s
LEFT OUTER JOIN Orders o ON s.id = o.id
GO
-- WHERE
SELECT s.SalesRep, o.Amount
FROM SalesRep s, Orders o
WHERE s.id = o.id
GO
Source: What is the Difference Between An INNER JOIN and WHERE Clause