ODBC Server Reference Manual

Transact-SQL Language
HP NonStop ODBC Server Reference Manual429151-002
4-85
ALL/DISTINCT Clause
ALL/DISTINCT Clause
The ALL/DISTINCT clause of the SELECT statement specifies the columns to be
included in the result of the query. The clause has the following syntax:
ALL or DISTINCT
specifies whether all rows or only distinct rows are to be included in the result of
the query:
ALL is the default.
[ table-reference.]*
retrieves all columns of a table or view. An asterisk (*) specifies all columns, in
CREATE TABLE order.
[ table-reference.]column-name
retrieves the specified columns in the order specified.
column-heading = [ table-reference.]column-name
retrieves the specified column and replaces the heading of the retrieved column
with the specified column-heading. The column-heading is an SQL Server
identifier. In SQL Server, these column headings are also called column aliases.
{ ALL } select-list
{ DISTINCT }
select-list is:
select-item [ , select-item ] ...
select-item is:
{ [table-reference.]* }
{ [table-reference.]column-name }
{ column-heading = [ table-reference.]column-name }
{ [table-reference.]column-name column-heading }
{ expression }
{ aggregate-function }
table-reference is:
[ [database.]owner.] { table-name }
{ view-name }
ALL Include all rows of the result table
DISTINCT Include only unique rows of the result table. Duplicate rows are
removed from the result table.