CREATE VIEW
Defines a view. Views are read only, so they do not support insert, update, delete, or copy operations.
Syntax
CREATE [ OR REPLACE ] VIEW [[database.]schema.]view [ (column[,…]) ] [ {INCLUDE|EXCLUDE} [SCHEMA] PRIVILEGES ] AS query
Parameters
OR REPLACE
|
Specifies to overwrite the existing view view‑name. If you omit this option and view‑name already exists, Any grants assigned to the view before you execute a CREATE OR REPLACE remain on the updated view. See GRANT (View). |
[database]schema
|
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
view |
Identifies the view to create, where view conforms to conventions described in Identifiers. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema. |
column[,…]
|
List of up to 9800 names to use as view column names. Vertica maps view column names to query columns according to the order of their respective lists. By default, the view uses column names as they are specified in the query. |
query |
A |
{INCLUDE|EXCLUDE}[SCHEMA] PRIVILEGES
|
Specifies whether this view inherits schema privileges:
For details, see Inherited Privileges in the Administrator's Guide. |
Privileges
See Creating Views
Examples
The following example shows how to create a view that contains data from multiple tables.
=> CREATE VIEW temp_t0 AS SELECT * from t0_p1 UNION ALL SELECT * from t0_p2 UNION ALL SELECT * from t0_p3 UNION ALL SELECT * from t0_p4 UNION ALL SELECT * from t0_p5;