0

Suppose I have following query:

Query 1

SELECT * FROM Table1 T1, Table2 T2
WHERE T1.ID = T2.ID

Query 2

  SELECT * FROM Table1 T1
    INNER JOIN Table T2 T2
    ON T1.ID = T2.ID

Is this 2 query always produce same result set and equivalent performance?

I am asking this as one of the existing project I am working on using Query 1 instead of Query 2 (no INNER JOIN used in reporting nor query). I am wondering if there is any extra benefits of using Query 1.

eulercode
  • 1,107
  • 4
  • 16
  • 29
  • 3
    Does this answer your question? [INNER JOIN vs multiple table names in "FROM"](https://stackoverflow.com/questions/5118562/inner-join-vs-multiple-table-names-in-from) – Jesse Nov 28 '21 at 13:38
  • 4
    Quite simply - don't use [old-style joins](https://sqlblog.org/2009/10/08/bad-habits-to-kick-using-old-style-joins). Yes, this is a case of an inner join where both return the same resultset. `SELECT *` is another bad habit as is the lack of aliases for the tables and the lack of schema-qualified table names. – SMor Nov 28 '21 at 13:42

0 Answers0