Contents Index Joins overview Join conditions

ASA SQL User's Guide
  Joins: Retrieving Data from Several Tables
    Joins overview

The FROM clause


Use the FROM clause to specify which base tables, temporary tables, views or derived tables to join. The FROM clause can be used in SELECT or UPDATE statements. An abbreviated syntax for the FROM clause is as follows:

FROM table_expression, ...

where:

table_expression:
 table | view | derived table | joined table | ( table_expression, ... )

table or view:
 [userid.table-or-view-name [ [ AS ] correlation-name ]

derived table:
 ( select-statement ) [ AS ] correlation-name [ ( column-name, ... ) ]

joined table:
 table_expression join_operator table_expression [ ON join_condition ]

join_operator:
 [ KEY | NATURAL ] [ join_type ] JOIN | CROSS JOIN

join_type:
 INNER | FULL [ OUTER ] | LEFT [ OUTER ] | RIGHT [ OUTER ]

Notes 

You cannot use an ON phrase with CROSS JOIN.

For the complete syntax, see FROM clause.

For the syntax of the ON phrase, see Search conditions.


Contents Index Joins overview Join conditions