Skip to main content
Skip table of contents

Alter View

You are looking at an older version of the documentation. The latest version is found here.

Usage

SQL
ALTER VIEW name[column_name column_type, ..., PRIMARY KEY(column_name)] AS queryExpression

PRIMARY KEY added in v2.4.20

Syntax Rules

  • The ALTER query expression may be prefixed with a cache hint for materialized view definitions. The hint will take effect the next time the materialized view table is loaded;
  • The number of columns in queryExpression must not be changed.

Example

SQL
CREATE VIEW views.countryregion AS SELECT * FROM adventureworks.countryregion;
CREATE VIEW views.creditcard AS SELECT * FROM adventureworks.creditcard;
ALTER VIEW views.creditcard AS SELECT * from (SELECT * FROM adventureworks.creditcard) a;
ALTER VIEW views.creditcard(a integer, b integer, PRIMARY KEY(a)) AS SELECT * FROM adventureworks.creditcard;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.