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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-104
CREATE VIEW Statement
CREATE VIEW Statement
Considerations for CREATE VIEW
Examples of CREATE VIEW
The CREATE VIEW statement creates an SQL/MX view. See Views on page 6-108.
CREATE VIEW view
[(column-name [heading] [,column-name [heading]]...)]
[LOCATION [\node.]$volume[.subvolume.filename]]
AS query-expr
[WITH [CASCADED] CHECK OPTION]
heading is:
HEADING 'heading-string' | NO HEADING
query-expr is:
non-join-query-expr | joined-table
non-join-query-expr is:
non-join-query-primary | query-expr UNION [ALL] query-term
query-term is:
non-join-query-primary | joined-table
non-join-query-primary is:
simple-table | (non-join-query-expr)
joined-table is:
table-ref [NATURAL] [join-type] JOIN table-ref [join-spec]
join-type is:
INNER | LEFT [OUTER] | RIGHT [OUTER]
join-spec is:
ON condition
simple-table is:
VALUES (row-value-const) [,(row-value-const)]...
| TABLE table
| SELECT [ALL | DISTINCT] select-list
FROM table-ref [,table-ref]...
[WHERE 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]
row-value-const is:
row-subquery | expression [,expression]...