Specifies a result table derived from the tables or views identified in the FROM clause. Subselect is a component of the fullselect statement, the CREATE VIEW statement, the INSERT statement, and certain predicates.
>>-select_clause--from_clause----+---------------+-------------->
'-where_clause--'
>-----+------------------+---+----------------+----------------><
'-group_by_clause--' '-having_clause--'
Produces a final result table by selecting only the columns indicated by the select list from R, where R is the result of the previous operation. For example, if the group-by-clause and having-clause are not specified, R is the result of the where-clause.
.-ALL------.
>>-SELECT----+----------+---+-*----------------------------+---><
'-DISTINCT-' | .-,-----------------------. |
| V | |
'----+-exp----------------+--+-'
+-table_name.*-------+
+-view_name.*--------+
'-correlation_name.*-'
Names a single table or view, or produces an intermediate result table. The intermediate result table contains all possible combinations of the rows of the named tables or views.
.-,-----------------------------------------.
V |
>>-FROM--------+-table_name-+---+------------------+---+-------><
'-view_name--' '-correlation_name-'
Produces an intermediate result table by applying search-condition to each row of R, where R is the result of the FROM clause. The result table contains the rows of R for which the search-condition is true.
>>-WHERE--search_condition-------------------------------------><
Produces an intermediate result table by grouping the rows of R, where R is the result of the previous clause.
.-,--------------.
V |
>>-GROUP BY-------column_name---+------------------------------><
Produces an intermediate result table by applying search-condition to each group of R, where R is the result of the previous clause.
>>-HAVING--search_condition------------------------------------><
Specifies a result table. If UNION is not used, the result of the fullselect is the result of the specified subselect.
>>-+-subselect----+--------------------------------------------->
'-(fullselect)-'
.------------------------------------------.
V |
>--------+------------------------------------+--+-------------><
'--+-UNION-----+---+-subselect----+--'
'-UNION ALL-' '-(fullselect)-'
Is the form of a query that can be specified or referenced in a DECLARE CURSOR statement and in the interactive select statement.
>>-fullselect----+--------------------+--+-------------+-------><
+-order_by_clause----+ '-with_clause-'
| (1) |
'-update_clause------'
Notes:
Orders the rows of the result table by the values of the identified columns.
.-,-----------------------------.
V .-ASC--. |
>>-ORDER BY--------+-column_name-+---+------+--+---------------><
'-integer-----' '-DESC-'
Refers to the cursor in a positioned UPDATE statement. The UPDATE statement can update only columns in the column-name list. This update-clause cannot be used interactively.
.-,--------------.
V |
>>-FOR UPDATE OF-------column_name---+-------------------------><
Specifies the isolation level at which the statement is executed.
>>-WITH----+-RR-+----------------------------------------------><
+-CS-+
'-UR-'