HP Neoview SQL Reference Manual page 147

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

table-ref [NATURAL] [join-type] JOIN table-ref [join-spec]
join-type is: CROSS |INNER | LEFT [OUTER] | RIGHT [OUTER] | FULL
[OUTER]
is a joined table. You specify the join-type by using the CROSS, INNER, OUTER, LEFT,
RIGHT, and FULL keywords. If you omit the optional OUTER keyword and use LEFT,
RIGHT, or FULL in a join, Neoview SQL assumes the join is an outer join.
If you specify a CROSS join as the join-type, you cannot specify a NATURAL join or
a join-spec.
If you specify an INNER, LEFT, RIGHT, or FULL join as the join-type and you do not
specify a NATURAL join, you must use an ON clause as the join-spec, as follows:
Subqueries are not allowed in the join predicate of FULL OUTER JOIN.
ON search-condition
specifies a search-condition for the join. Each column reference in
search-condition must be a column that exists in either of the two result tables
derived from the table references to the left and right of the JOIN keyword. A join of
two rows in the result tables occurs if the condition is satisfied for those rows.
The type of join and the join specification if used determine which rows are joined from
the two table references, as follows:
table-ref CROSS JOIN table-ref
joins each row of the left table-ref with each row of the right table-ref.
table-ref NATURAL JOIN table-ref
joins rows only where the values of all columns that have the same name in both
tables match. This option is equivalent to NATURAL INNER.
table-ref NATURAL LEFT JOIN table-ref
joins rows where the values of all columns that have the same name in both tables
match, plus rows from the left table-ref that do not meet this condition.
table-ref NATURAL RIGHT JOIN table-ref
joins rows where the values of all columns that have the same name in both tables
match, plus rows from the right table-ref that do not meet this condition.
table-ref JOIN table-ref ON
joins only rows that satisfy the condition in the ON clause. This option is equivalent
to INNER JOIN ... ON.
table-ref LEFT JOIN table-ref ON
joins rows that satisfy the condition in the ON clause, plus rows from the left
table-ref that do not satisfy the condition.
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.
table-ref FULL OUTER JOIN table-ref ON
combines the results of both left and right outer joins. These joins show records from
both tables and fill in NULLs for missing matches on either side
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]...
[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]]]...]
SELECT Statement
147

Advertisement

Table of Contents
loading

Table of Contents