View Syntax


The CREATE VIEW statement creates a new view (see , "CREATE VIEW Syntax"). To alter the definition of a view or drop a view, use ALTER VIEW (see , "ALTER VIEW Syntax"), or DROP VIEW (see , "DROP VIEW Syntax").

A view can be created from many kinds of SELECT statements. It can refer to base tables or other views. It can use joins, UNION, and subqueries. The SELECT need not even refer to any tables. The following example defines a view that selects two columns from another table, as well as an expression calculated from those columns:

Retornar