SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-178
SELECT Statement
[ANY N] | [FIRST N]
specifies whether to select ANY of the first N rows or the FIRST N sorted rows.
You must enclose ANY N or FIRST N in square brackets. [FIRST N] is different
from [ANY N] only if you use ORDER BY on any of the columns in the select list
to sort the result table of the SELECT statement. N is an unsigned numeric literal
with no scale. If N is greater than the number of rows in the table, all rows are
returned. [ANY N] and [FIRST N] are disallowed in nested SELECT statements
and on either side of a UNION operation.
ALL | DISTINCT
specifies whether to retrieve all rows whose columns are specified by the
select-list (ALL) or only rows that are not duplicates (DISTINCT). Nulls are
considered equal for the purpose of removing duplicates. The default is ALL.
select-list
specifies the columns or column expressions to select from the table references in
the FROM clause.
*
specifies all columns in a table, view, joined table, or derived table determined
by the evaluation of a query expression, as specified in the FROM clause.
corr.*
specifies all columns of specific table references by using the correlation name
corr of the table references, as specified in the FROM clause. See
Correlation Names on page 6-10.
corr.
specifies one column of specific table references by using the correlation name
corr of the table reference, as specified in the FROM clause.
single-col [[AS] name]
specifies a column.
col-expr [[AS]name]
specifies a derived column determined by the evaluation of an SQL value
expression in the list. By using the AS clause, you can associate a derived
column col-expr with a name.
See the discussion of limitations in Considerations for Select List on page 2-194.
INTO variable-spec [,variable-spec]...
specifies host variables in which to return the values in the result row of the
SELECT statement. The number of items in select-list must be equal to the
Embed