The subselect is a component of the fullselect.
>>-select-clause--from-clause--+--------------+-----------------> '-where-clause-' >--+-----------------+--+---------------+-----------------------> '-group-by-clause-' '-having-clause-' >--+-----------------+--+--------------------+------------------> '-order-by-clause-' '-fetch-first-clause-' >--+------------------+---------------------------------------->< '-isolation-clause-'
A subselect specifies a result table derived from the tables, views or nicknames identified in the FROM clause. The derivation can be described as a sequence of operations in which the result of each operation is input for the next. (This is only a way of describing the subselect. The method used to perform the derivation can be quite different from this description. If portions of the subselect do not actually need to be executed for the correct result to be obtained, they might or might not be executed.)
The authorization for a subselect is described in the Authorization section in "SQL queries".
SELECT * FROM T1
ORDER BY C1
UNION
SELECT * FROM T2
ORDER BY C1
The following example is valid:
(SELECT * FROM T1
ORDER BY C1)
UNION
(SELECT * FROM T2
ORDER BY C1)