Neoview SQL Reference Manual (R2.2)
HAVING search-condition
specifies a search-condition to apply to each group of the grouped table resulting from
the preceding GROUP BY clause in the SELECT statement. The GROUP BY clause, if one
exists, must precede the HAVING clause in the SELECT statement.
To comply with ANSI standards, Neoview SQL does not move aggregate predicates from
the WHERE clause to a HAVING clause and does not move non-aggregate predicates from
the HAVING clause to the WHERE clause.
If there is no GROUP BY clause, the search-condition is applied to the entire table (which
consists of one group) resulting from the WHERE clause (or the FROM clause if there is no
WHERE clause).
In search-condition, you can specify any column as the argument of an aggregate (or
set) function; for example, AVG (SALARY). An aggregate function is applied to each group
in the grouped table.
A column that is not an argument of an aggregate function must be a grouping column.
When you refer to a grouping column, you are referring to a single value because each row
in the group contains the same value in the grouping column.
See “Search Condition” (page 248).
[FOR] access-option ACCESS
specifies the access-option when accessing data specified by the SELECT statement or
by a table reference in the FROM clause derived from the evaluation of a query expression
that is a SELECT statement. See “Data Consistency and Access Options” (page 30).
READ UNCOMMITTED
specifies that any data accessed need not be from committed rows.
READ COMMITTED
specifies that any data accessed must be from committed rows.
SERIALIZABLE | REPEATABLE READ
specifies that the SELECT statement and any concurrent process (accessing the same data)
execute as if the statement and the other process had run serially rather than concurrently.
SKIP CONFLICT
enables transactions to skip rows locked in a conflicting mode by another transaction.
You cannot use SKIP CONFLICT in a SET TRANSACTION statement.
IN {SHARE | EXCLUSIVE} MODE
specifies that SHARE or EXCLUSIVE locks be used when accessing data specified by a
SELECT statement or by a table reference in the FROM clause derived from the evaluation
of a query expression that is a SELECT statement. The specified locks are also used when
accessing the index, if any, through which the table accesses occur.
UNION [ALL] select-stmt
specifies a set union operation between the result table of a SELECT statement and the result
table of another SELECT statement.
The result of the union operation is a table that consists of rows belonging to either of the
two contributing tables. If you specify UNION ALL, the table contains all the rows retrieved
by each SELECT statement. Otherwise, duplicate rows are removed.
The select lists in the two SELECT statements of a union operation must have the same
number of columns, and columns in corresponding positions within the lists must have
compatible data types. The select lists must not be preceded by [ANY N] or [FIRST N].
The number of columns in the result table of the union operation is the same as the number
of columns in each select list. The column names in the result table of the union are the same
as the corresponding names in the select list of the left SELECT statement. A column resulting
from the union of expressions or constants has the name (EXPR).
See “Considerations for UNION” (page 154).
150 SQL Statements