CREATE VIEW

circle-info

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentationarrow-up-right

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected]envelope.

Thank you for your understanding.

chevron-rightApplies tohashtag
circle-exclamation

Description

Views are based on the result-set of an SQL query. CREATE VIEW constructs a virtual table that has no physical data therefore other operations like ALTER VIEW and DROP VIEW only change metadata. (Spark SQL Language Reference CREATE VIEWarrow-up-right)

Grammar Syntax

CREATE [ OR REPLACE ] [ [ GLOBAL ] TEMPORARY ] VIEW [ IF NOT EXISTS ] view_identifier
    create_view_clauses AS query

create_view_clauses :=
[ ( column_name [ COMMENT column_comment ], ... ) ]
[ COMMENT view_comment ]
[ TBLPROPERTIES ( property_name = property_value [ , ... ] ) ]

Sample Source Patterns

COMMENT clause

Input Code:

Output Code:

OR REPLACE

circle-check

TEMPORARY (non-GLOBAL) VIEW

circle-check

IF NOT EXISTS

circle-check

Columns list

circle-check

Last updated