CREATE VIEW

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 Documentation

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

Thank you for your understanding.

Applies to

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 VIEW)

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

TEMPORARY (non-GLOBAL) VIEW

IF NOT EXISTS

Columns list

Last updated