Neoview SQL Reference Manual (R2.4 SP2)
RETURN old.empno,old.salary,new.salary,
(new.salary - old.salary)
AS emp (empno, oldsalary, newsalary, increase).
(insert-statement) [AS] corr [(col-expr-list)]
For the syntax of insert-statement, see the “INSERT Statement” (page 143).
[AS] corr [(col-expr-list)]
specifies an optional correlation name and an optional column list.
joined-table
A joined-table can be specified as:
table-ref [join-type] JOIN table-ref join-spec
| table-ref NATURAL [join-type] JOIN table-ref
| table-ref CROSS JOIN table-ref
| (joined-table)
join-type is: 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 NATURAL FULL JOIN table-ref
joins rows where the values of all columns that have the same name in both tables
match, plus rows from either side that do not meet this condition, filling in NULLs
for missing values.
table-ref JOIN table-ref join-spec
joins only rows that satisfy the condition in the join-spec clause. This option is
equivalent to INNER JOIN ... ON.
168 SQL Statements