sqloracle-databasejoinansi-92

Joins in Oracle: Which field on which side of an = sign?


When joining tables with either the ANSI-89 (old) or the ANSI-92 ("new") method of joining tables, does it matter which side you place the fields from the 2 joining tables.

For example, is it better to do:

From 
TABLE_1 A

Join
TABLE_2 B
    on A.ID = B.ID

Or is the following better?

    on B.ID = A.ID

Is it simply aesthetics? Or does it effect how the joins work?

EDIT: For further clarification, what about Left Joins? For example:

From
TABLE_1 A

Left Join
TABLE_2 B
    on A.ID = B.ID

Is this the same as

    on B.ID = A.ID

However, if using ANSI-89 Where A.ID = B.ID (+) is NOT the same as Where B.ID = A.ID (+) since the second joins A ONTO B?


Solution

  • It makes no difference. The only time the order matters is when you are doing LEFT and RIGHT OUTER joins, but those keywords all fall before the ON keyword.