tencent cloud

Feedback

CREATE VIEW AS

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;
    
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support