tencent cloud

Data Lake Compute

CREATE VIEW AS

Download
Focus Mode
Font Size
Last updated: 2024-08-07 17:22:11

Description

Supported engines: Presto and SparkSQL
Purpose: Create view.

Standard Statement

CREATE [ OR REPLACE ] VIEW [IF NOT EXISTS] view_name
[(column_name [COMMENT 'column_comment'][, ...])]
[COMMENT 'view_comment']
AS select_statement

Parameter

[IF NOT EXISTS]: Create a view if no such view exists.
view_name: View name
[(column_name [COMMENT 'column_comment'][, ...])]: Column name, which can be followed by a column comment.
[COMMENT 'view_comment']: View comment
select_statement: Query statement.

Example

create or replace view db1.v1 as select x,y from tbl;

create view test_view (id comment 'test c1', name_length comment 'test name c2') as select id, length(name) from test;




Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback