sql-serverdatabasejoinansi-sql-92

How to join table without using JOIN or any alias? SQL Server


I was wondering is it possible to do a join on two tables without using JOIN or any alias for the tables?

For example I usually do:

SELECT * 
FROM table1 a
LEFT JOIN table2 b ON a.column = b.column

From my understanding, the join I did above is ANSI-92 syntax, is this correct?

Is it possible to do this same join without using the JOIN keyword or any alias for the tables? If so, what is this called? And would you also be able to give me an example of what this join would look like based on my example?

Thanks!


Solution

  • Legacy-style syntax for a left join (SQL Server only):

    SELECT  *
    FROM    TableA a, TableB b
    WHERE   a.Id *= b.Id
    

    But this should never be used.