FROM Clause

The FROM clause of the SELECT statement lists table objects from which to retrieve data.

This syntax fragment is part of the SELECT statement.

Read syntax diagramSkip visual syntax diagram
FROM Clause

|--FROM--------------------------------------------------------->

   .-,-----------------------------------------------------------------------------.   
   |          .---------------------------------------------.                      |   
   |          |                    .--------------------.   |                      |   
   V          V                    V                (1) |   |                      |   
>----+-+---+----| ANSI Tables |------| ANSI Joins |-----+---+--+---+-------------+-+--|
     | '-(-'                                                   '-)-'             |     
     |                       .-,-----------------------------------------------. |     
     |                       V                                                 | |     
     +-+-| ANSI Tables |--+----+---------------------------------------------+-+-+     
     | '-| Other Tables |-'    |  (2)                                    (3) |   |     
     |                         '-------,--| Informix OUTER Join Clause |-----'   |     
     |                           (4)                                             |     
     '-| Lateral derived table |-------------------------------------------------'     

ANSI Tables

|--+---+-synonym-------------+----+-------------------+-+-------|
   |   +-table---------------+    |               (5) | |   
   |   +-view----------------+    '-+----+--alias-----' |   
   |   '-ONLY--+-(table )--+-'      '-AS-'              |   
   |           '-(synonym)-'                            |   
   |  (2)                               (6)             |   
   '-----+-| Collection Derived Table |-----+-----------'   
         |              (7)                 |               
         '-| Iterator |---------------------'               

Other Tables

|--+---external----+-------------------------------------------------+------------------------+--|
   |               |               (5)                               |                        |   
   |               '-+----+--alias------+--------------------------+-'                        |   
   |                 '-AS-'             |    .-,--------------.    |                          |   
   |                                    |    V                |    |                          |   
   |                                    '-(----derived_column-+--)-'                          |   
   |   (8)                             (9)                                                    |   
   +-(------| Collection Subquery |--)--------------------------------------------------------+   
   +-(--subquery--)---------------------------------------------------------------------------+   
   |                                                                    .-,--------------.    |   
   |                                                            (5)     V                |    |   
   '-+-+-table---+-----------------------------+--+----+--alias------(----derived_column-+--)-'   
     | +-view----+                             |  '-AS-'                                          
     | '-synonym-'                             |                                                  
     |  (2)          (10)                 (11) |                                                  
     '-------ONLY--(-------+-table---+--)------'                                                  
                           '-synonym-'                                                            

Notes:
  1. See ANSI Joins
  2. Informix extension
  3. See Informix-Extension Outer Joins
  4. See Lateral derived tables
  5. See Aliases for Tables or Views
  6. See Collection-Derived Table
  7. See Iterator Functions
  8. Informix extension
  9. See Collection Subquery
  10. Must specify a supertable within a typed table hierarchy
  11. See The ONLY Keyword
Element Description Restrictions Syntax
alias Temporary name for a table, view, or derived table in this query See Aliases for Tables or Views. Identifier
derived _column Temporary name for a derived column in a table expression Unless the underlying collection is a ROW type, you can declare no more than one derived_column name Identifier
external External table from which to retrieve data Must exist, but cannot be the outer table in an outer join Database Object Name
subquery Nested query whose results are available to the outer query See Table expressions SELECT statement
synonym, table, view Synonym for a table from which to retrieve data Synonym and table or view to which it points must exist. Must include appropriate qualifiers. Database Object Name

Every SELECT statement requires the FROM clause, whether or not any data source is required. If your query uses the database server to evaluate an expression that requires no data source, the FROM clause can reference any existing table in the current database on which you hold sufficient access privileges, as in the following example:

SELECT ATANH(SQRT(POW(4,2) + POW(5,2))) FROM systables;