SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
S-19
SELECT Statement
[ ALL | DISTINCT ]
specifies whether to retrieve all rows of the intermediate table described by the
FROM clause or only rows that are not duplicates (DISTINCT rows). NULL values
are considered equal for removing duplicates.
The default is ALL.
select-list
specifies the columns to select from the intermediate table described by the FROM
clause:
expr is an SQL expression that is not a subquery. Columns named in expr must
be from tables or views specified in the FROM clause but can include
system-defined primary keys. (Qualify SYSKEY if you want to select the SYSKEY
column from more than one table or view: for example, EMPLOYEE.SYSKEY.)
If you refer to a grouped view in the FROM clause, expr cannot include an
aggregate function on a column of the grouped view. A grouped view is a view
defined with a CREATE VIEW AS clause that contains a GROUP BY or HAVING
clause that is not in a subquery, contains an aggregate function in the select list, or
refers to a grouped view in the FROM clause.
If expr is a single column name or a qualified column name, that column of the
result table is a named column. All other columns are unnamed columns.
The * and corr.* forms of a select-list specification are convenient for use in
SQLCI but should be avoided in programs. Such specifications make the order of
columns in the result table dependent on the order of columns in the current
definition of the referenced tables or views. If columns have been added, the
retrieved values might not be in the order the program is coded to use.
INTO :host-variable [ , :host-variable ] ...
(allowed in programs only) specifies host variables in which to return the result of a
query.
You can use the IN clause only for operations that are not union operations and
that return no more than one row. (If the query returns more than one row, use a
cursor.) For information on using host variables and handling null values that might
be returned to host variables, see the SQL/MP programming manual for your host
language.
List Item Columns of Intermediate Table Retrieved
* All columns, including SYSKEYs for view
corr.* All columns in the table or view implicitly or explicitly associated with
correlation name corr except the SYSKEY of a table
expr The columns required to evaluate the expression expr