The INNER and OUTER JOIN syntax was formalized in the SQL-92 specification. In many database products such as MySQL and SQL Server, you can omit the "INNER" word from inner joins and simply use "JOIN". Similarly, many database products let you omit the word "OUTER" and simply use "LEFT JOIN" or "RIGHT JOIN" for outer joins. The old outer join syntax of *=
or =*
created ambiguities in many circumstances. Many products have or very soon will stop supporting the old outer join syntax.
Prior to the SQL-92 specification, the vendors each used their own syntax indicated an outer join. I.e., *=
was not universal (I seem to remember someone using ?=
). In addition, they did not implement the outer join in a universal way. Take the following example:
Table1
Col1 Col2
1 Alice
2 Bob
Table2
Col1 Col2
1 1
2 2
3 3
4 4
Select
From Table1, Table2
Where Table2.Col1 *= Table1.Col1
The above query would generally yield:
1 1 1 Alice
2 2 2 Bob
3 3 Null Null
4 4 Null Null
Now try:
Select
From Table1, Table2
Where Table2.Col1 *= Table1.Col1
And Table2.Name = 'Alice'
On some database products, you would get:
1 1 1 Alice
On others you would get:
1 1 1 Alice
2 2 Null Null
3 3 Null Null
4 4 Null Null
In short, it is ambiguous as to whether the filtering on the unpreserved table should be applied before or after the join.