|
|
|
NATURAL JOINNATURAL JOIN The NATURAL keyword indicates that a natural join is being performed. A natural join is based on all columns in the two tables that have the same name. It selects rows from the two tables that have equal values in the relevant columns. When specifying columns that are involved in the natural join, do not qualify the column name with a table name or table alias. On occasion, the table pairings in natural or cross joins may be ambiguous. For example: a NATURAL LEFT JOIN b LEFT JOIN c ON b.c1 = c.c1can be interpreted in either of the following ways: a NATURAL LEFT JOIN (b LEFT JOIN c ON b.c1 = c.c1) (a NATURAL LEFT JOIN b) LEFT JOIN c ON b.c1 = c.c1To avoid this ambiguity, you can use parentheses to specify the pairings of joined tables. In the absence of such parentheses, the database uses left associativity, pairing the tables from left to right. Restriction on Natural Joins You cannot specify a LOB column, columns of ANYTYPE , ANYDATA , or ANYDATASET , or a collection column as part of a natural join. |
|