Files
doc-exports/docs/dli/sqlreference/dli_08_15009.html
Su, Xiaomeng be9eabe464 dli_sqlreference_20250305
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2025-03-25 09:06:21 +00:00

1.7 KiB

CREATE VIEW

Function

This statement creates a view based on the given query statement. If a view with the same name already exists in the database, an exception is thrown.

Syntax

CREATE [TEMPORARY] VIEW [IF NOT EXISTS] [catalog_name.][db_name.]view_name
  [{columnName [, columnName ]* }] [COMMENT view_comment]
  AS query_expression

Description

TEMPORARY

Create a temporary view with catalogs and database namespaces and overwrite the original view.

IF NOT EXISTS

If the view already exists, nothing happens.

Example

Create a view named viewName.

create view viewName as select * from dataSource