SQL$HELP_OLD72.HLB  —  Select Expressions, Arguments  NATURAL_JOIN
    Performs an equijoin operation on the matching named columns of
    the specified tables. An equijoin matches values in columns from
    one table with the corresponding values of columns in another
    table implicitly using an equal (=)  sign.

    A NATURAL JOIN implicitly performs the following functions:

    o  Coalesces the common columns to condense the columns into a
       single column and, therefore, you cannot qualify the common
       column

    o  Performs an equijoin using common columns between table
       references

    You cannot specify an explicit join condition if the NATURAL
    keyword is specified in the query. Following is an example of a
    natural join. Note the common column C1 is only shown once. Other
    types of join conditions return the common column as often as it
    occurs in the table's references.

    SQL> SELECT *
    cont> FROM TABLE1 NATURAL LEFT OUTER JOIN TABLE2;
              C1     TABLE1.C2   TABLE2.C4
              10            15          AA
              20            25          CC
              30            35        NULL
    3 rows selected

    The complexity of what the NATURAL LEFT OUTER JOIN is implicitly
    executing in the previous example is shown in the following
    example:

    SQL> SELECT
    cont>   COALESCE (TABLE1.C1, TABLE2.C1) AS C1,
    cont>   TABLE1.C2, TABLE2.C4
    cont> FROM TABLE1 LEFT OUTER JOIN TABLE2
    cont> ON TABLE1.C1 = TABLE2.C1;
              C1     TABLE1.C2   TABLE2.C4
              10            15          AA
              20            25          CC
              30            35        NULL
    3 rows selected

    The NATURAL keyword can be specified for INNER, LEFT OUTER, RIGHT
    OUTER, and FULL OUTER joins.

    A natural join between two table references that do not share
    matching named columns results in a Cartesian product.
Close Help