Alters the SELECT query of an existing, non-materialized view.

Syntax

ALTER VIEW viewName [ columnList ] AS SELECT selectQuery ;

Arguments

  • viewName: The name of the existing view.

  • columnList: A list of columns for the view. Include this list regardless of whether the

  • columnList changes over the previous definition for this view. This list must match the number or columns returned from selectQuery. columnList is only required when specifying column names other than those returned from selectQuery.

  • selectQuery: See SELECT

Examples

ALTER VIEW customer2012 AS SELECT * FROM MYSQL.inventory.customer WHERE createDate > '2012-01-01';
ALTER VIEW customer2012, 2012Name, 2012PurchaseTotal AS SELECT Name, PurchaseTotal FROM MYSQL.inventory.customer WHERE createDate > '2012-01-01'

See Also