Skip to content
Rene Saarsoo edited this page Jul 17, 2022 · 8 revisions

SQL standard specifies the following CREATE VIEW syntax:

CREATE [RECURSIVE] VIEW

Dialects have considerable variation:

BigQuery:

CREATE [OR REPLACE] VIEW [IF NOT EXISTS]

DB2:

CREATE [OR REPLACE] VIEW

Hive:

CREATE VIEW [IF NOT EXISTS]

MariaDB:

CREATE
  [OR REPLACE]
  [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]
  [SQL SECURITY { DEFINER | INVOKER }]
  VIEW [IF NOT EXISTS]

MySQL:

CREATE
  [OR REPLACE]
  [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
  [DEFINER = user]
  [SQL SECURITY { DEFINER | INVOKER }]
  VIEW

N1QL:

No support for CREATE VIEW.

PL/SQL:

CREATE [OR REPLACE] [[NO] FORCE] [EDITIONING | EDITIONABLE [EDITIONING] | NONEDITIONABLE] VIEW

PostgreSQL:

CREATE [OR REPLACE] [TEMP | TEMPORARY] [RECURSIVE] VIEW

Redshift:

CREATE [OR REPLACE] VIEW

Spark:

CREATE [OR REPLACE] [[GLOBAL] TEMPORARY] VIEW [IF NOT EXISTS]

SQLite:

CREATE [TEMPORARY | TEMP] VIEW [IF NOT EXISTS]

Transact-SQL:

CREATE [OR ALTER] VIEW

Trino:

CREATE [OR REPLACE] VIEW
Clone this wiki locally