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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-182
SELECT Statement
[OLD.| NEW.]*
specifies the row from the OLD or NEW table exposed by the
embedded UPDATE. The OLD table refers to column values before the
update operation; the NEW table refers to column values after the
update operation. If a column has not been updated, the NEW value is
equivalent to the OLD value.
An implicit NEW.* return list is assumed for an embedded update
operation that does not specify a RETURN list.
col-expr [[AS]name]
specifies a derived column determined by the evaluation of an SQL
value expression in the list. Any column referred to in a value
expression can be specified as from the row in the OLD table exposed
by the embedded UPDATE or can be specified as being from the row
in the NEW table exposed by the embedded UPDATE.
For example: RETURN old.empno,old.salary,new.salary,
(new.salary - old.salary).
By using the AS clause, you can associate a derived column
col-expr with a name name.
[AS] corr [(col-expr-list)]
specifies an optional correlation name corr and an optional column list
for the preceding items in the select list RETURN select-list.
For example:
RETURN old.empno,old.salary,new.salary,
(new.salary - old.salary)
AS emp (empno, oldsalary, newsalary, increase).
table-ref [NATURAL] [join-type] JOIN table-ref [join-spec]
join-type is:
CROSS |INNER | LEFT [OUTER] | RIGHT [OUTER]
is a joined table. You specify the join-type by using the CROSS, INNER,
OUTER, LEFT, and RIGHT keywords. If you omit the optional OUTER keyword
and use LEFT or RIGHT in a join, NonStop SQL/MX 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, or RIGHT 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: