DROP VIEW

This MySQL statement deletes a view. Multiple views may be given in a comma-separated list.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

DROP VIEW [IF EXISTS] view[, ...] [RESTRICT|CASCADE]

Explanation

This statement deletes a view. Multiple views may be given in a comma-separated list. The IF EXISTS flag prevents error messages if one of the specified views doesn't exist. Instead a note will be generated, which can be displayed afterwards by executing the SHOW WARNINGS statement. Any other views given with the statment that do exist will be dropped.

The RESTRICT or CASCADE options are reserved for a future release of MySQL. This statement is available as of version 5.0.1 of MySQL and requires DROP privilege for the view being deleted.