CREATE MATERIALIZED VIEW

Description

Creates a materialized view based on one or more Amazon Redshift tables. You can also base materialized views on external tables created using Spectrum or federated queries.

Grammar Syntax

The following is the SQL syntax to create a view in Amazon Redshift. Click here to here to go to Redshifts specification for this syntax.

CREATE MATERIALIZED VIEW mv_name
[ BACKUP { YES | NO } ]
[ table_attributes ]
[ AUTO REFRESH { YES | NO } ]
AS query             

Sample Code

Considering the obligatory and optional clauses in Redshift command, the output after migration to Snowflake is very similar.

CREATE MATERIALIZED VIEW myuser AS
SELECT lastname FROM users;

There are some elements that are not supported, an EWI is implemented to cover those cases.

Last updated