ODBC Server Reference Manual

CORE SQL Language
HP NonStop ODBC Server Reference Manual429151-002
3-58
Examples
GROUP BY Clause
The GROUP BY clause of the SELECT statement specifies the groups into which the
table will be divided; it has the following syntax:
column-identifier
is the name of a column from one of the tables in the FROM clause.
HAVING Clause
The HAVING clause of the SELECT statement sets conditions for the GROUP BY
clause and has the following syntax:
Search conditions are described under Language Elements on page 3-2.
UNION Clause
The UNION clause of the SELECT statement specifies that the result table is to
contain all the rows of the tables defined by both the query-specification in the
WHERE clause and the query-specification in the UNION clause; it has the
following syntax:
ORDER BY Clause
The ORDER BY clause of the SELECT statement specifies the order in which to sort
the rows of the result table; it has the following syntax:
unsigned-integer
is a number from 1 to n that specifies the position of an item in the select-item
list; the sorting order of that item is used as the sorting order of the result table
rows. For example:
select col_1,col_2 from table_1 order by 1
GROUP BY column-identifier [,column-identifier ] ...
HAVING search-condition
UNION query-specification
ORDER BY sort-specification [, sort-specification ] ...
sort-specification is:
{ unsigned-integer } [ ASC | DESC ]
{ column-name }