CREATE [ OR REPLACE ] VIEW [IF NOT EXISTS] view_name[(column_name [COMMENT 'column_comment'][, ...])][COMMENT 'view_comment']AS select_statement
[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 commentselect_statement: Query statement.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;
Feedback