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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-184
SELECT Statement
table-ref RIGHT JOIN table-ref ON
joins rows that satisfy the condition in the ON clause, plus rows from the
right table-ref that do not satisfy the condition.
The three ways a simple-table can be specified are:
VALUES (row-value-const) [,(row-value-const)]...
| TABLE table
| SELECT [ALL | DISTINCT] select-list
FROM table-ref [,table-ref]...
| FROM ROWSET [rowset-size]
(:array-name [,:array-name]...)
[WHERE search-condition | rowset-search-condition]
[SAMPLE sampling-method]
[TRANSPOSE transpose-set [transpose-set]...
[KEY BY key-colname]]...
[SEQUENCE BY colname [ASC[ENDING] | DESC[ENDING]]
[,colname [ASC[ENDING] | DESC[ENDING]]]...]
[GROUP BY colname [,colname]...]
[HAVING search-condition | rowset-search-condition]
[[FOR] access-option ACCESS]
[IN {SHARE | EXCLUSIVE} MODE]
A simple-table can be a table value constructor. It starts with the VALUES
keyword followed by a sequence of row value constructors, each of which is
enclosed in parentheses. A row-value-const is a list of expressions (or
NULL) or a row subquery (a subquery that returns a single row of column
values). An operand of an expression cannot reference a column (except when
the operand is a scalar subquery returning a single column value in its result
table).
The use of NULL as a row-value-const element is an SQL/MX extension.
A simple-table can be specified by using the TABLE keyword followed by a
table name, which is equivalent to the query specification SELECT * FROM
table.
A simple-table can be a query specification—that is, a SELECT statement
consisting of SELECT ... FROM ... with optionally the WHERE, SAMPLE,
TRANSPOSE, SEQUENCE BY, GROUP BY, and HAVING clauses. This form
of a simple table is typically used in an INSERT, CREATE VIEW, or DECLARE
CURSOR statement.
FROM ROWSET rowset-size
restricts the size of the rowset-derived table to the specified size, which must
be less than or equal to the allocated size for the rowset. The size, if specified,
immediately follows the ROWSET keyword. The size is an unsigned integer or
a host variable whose value is an unsigned integer. If you do not specify the
size, NonStop SQL/MX uses the allocated rowset size specified in the SQL
Declare Section.
Embed