Is the second query a short form of the first? Is the second one doing something like an implicit JOIN?? They both return the same result…So I’d like to know which one is better to use. Using SQL Server 2008. Thanks for your answers.
First Query
SELECT b.columnOne, a.columnTwo
FROM tableA As a JOIN tableB As b ON a.id = b.id
Second Query
SELECT b.columnOne, a.columnTwo
FROM tableA As a, tableB as b
WHERE a.id = b.id
They are identical. The second one is not using ANSI-standard join whereas the first one is.
Many, although not all, developers prefer the first version (ANSI-standard) as it keeps the
JOINlogic in one place. It allows filter logic to be kept in theWHEREclause.