|
CREATE VIEWNameCREATE VIEW — Constructs a virtual tableCREATE VIEW view AS SELECT query Inputs
Outputs
DescriptionCREATE VIEW will define a view of a table or class. This view is not physically materialized. Specifically, a query rewrite retrieve rule is automatically generated to support retrieve operations on views. NotesCurrently, views are read only. Use the DROP VIEW statement to drop views. UsageCreate a view consisting of all Comedy films: CREATE VIEW kinds AS SELECT * FROM films WHERE kind = 'Comedy'; SELECT * FROM kinds; code | title | did | date_prod | kind | len -------+---------------------------+-----+------------+--------+------- UA502 | Bananas | 105 | 1971-07-13 | Comedy | 01:22 C_701 | There's a Girl in my Soup | 107 | 1970-06-11 | Comedy | 01:36 (2 rows) CompatibilitySQL92SQL92 specifies some additional capabilities for the CREATE VIEW statement: CREATE VIEW view [ column [, ...] ] AS SELECT expression [ AS colname ] [, ...] FROM table [ WHERE condition ] [ WITH [ CASCADE | LOCAL ] CHECK OPTION ] The optional clauses for the full SQL92 command are:
|
|||||||||||||||||
With any suggestions or questions please feel free to contact us |