Skip to main content
Creates a view, which is useful to filter, focus, and simplify a data set for querying. Views provide a level of abstraction that can make subqueries easier to write, especially for commonly referenced subsets of data. View results are not stored for future usage. Each time a query references a view, the view runs its SELECT query. For this reason, views do not provide a performance advantage. Consider using a materialized common table expression (CTE) as an alternative. For more information, see Materialized common table expressions. The optional IF NOT EXISTS and OR REPLACE clauses are mutually exclusive. They specify behavior if a view with the same name already exists. If neither clause is specified, an error occurs if a view with the same <view_name> already exists.

Syntax

—OR—

Parameters

Examples

Filtering a table

Wrapping an Iceberg table

You can wrap a READ_ICEBERG TVF call in a view for easier querying of Iceberg tables:
For a complete guide, see Simplifying queries with views.