1

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!

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
bingaloman
  • 43
  • 1
  • 2
  • 9
  • This is the **proper** ANSI-92 syntax - and you **SHOULD USE** this syntax and **NOT** go back to any older ways of joining! – marc_s Jan 04 '18 at 20:38
  • 1
    Plus @YCF_L the OP used a `LEFT JOIN`, what you wrote would be an implicit `INNER JOIN`. – Thom A Jan 04 '18 at 20:40
  • I understand this is the way I should be doing it, but I just want to know how the older way was done as well. – bingaloman Jan 04 '18 at 20:45

1 Answers1

0

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.

Steve
  • 950
  • 7
  • 11