ALTER VIEW

Description

Modifies the definition of a view.

Syntax

ALTER VIEW [db_name.]<view_name>
(<column_name>[ COMMENT 'column comment']
    [, column2, ...])
AS <query_statement>

Parameters

ParameterDescription
db_nameThe name of the database where the view resides.
view_nameThe name of the view.
column_nameThe name of the column(s) in the view. Note that the columns in the view and the columns queried in the query_statement must agree in number.
COMMENTThe comment on the column in the view or the view itself.
query_statementThe query statement used to create the view. It can be any query statement supported by CelerData.

Usage Notes

  1. A logical view does not store physical data. It only stores the query statement. Therefore, modifying the definition of views is equivalent to modifying query_statement.
  2. query_statement is arbitrarily supported SQL.

Examples

Alter example_view on example_db.

ALTER VIEW example_db.example_view
(
c1 COMMENT "column 1",
c2 COMMENT "column 2",
c3 COMMENT "column 3"
)
AS SELECT k1, k2, SUM(v1) 
FROM example_table
GROUP BY k1, k2