Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.4Mb
PDF (A4) - 31.4Mb
PDF (RPM) - 29.6Mb
HTML Download (TGZ) - 7.3Mb
HTML Download (Zip) - 7.4Mb
HTML Download (RPM) - 6.3Mb
Man Pages (TGZ) - 177.7Kb
Man Pages (Zip) - 288.0Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb
Excerpts from this Manual

13.1.31 DROP VIEW Syntax

    view_name [, view_name] ...

DROP VIEW removes one or more views. You must have the DROP privilege for each view.

If any views named in the argument list do not exist, the statement returns an error indicating by name which nonexisting views it was unable to drop, but also drops all views in the list that do exist.

The IF EXISTS clause prevents an error from occurring for views that don't exist. When this clause is given, a NOTE is generated for each nonexistent view. See Section, “SHOW WARNINGS Syntax”.

RESTRICT and CASCADE, if given, are parsed and ignored.

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
  Posted by Denis TRUFFAUT on June 3, 2012
A short explanation about multi drop view statements :

-- CREATE view1
SELECT id FROM mytable WHERE id < 5

-- DROP view2 (not existing) and view1 (existing)
DROP VIEW view2, view1;

-- Do some statements after drop
SELECT id FROM mytable LIMIT 0,5


-- Now, what happens ?

-- An error is generated for view2
-- (ERROR 1146 (42S02) at line 2: Table 'mydatabase.view1' doesn't exist)

-- view1 is dropped

-- It means, that even if a drop fail in a multi drop view statement, other drops are executed, independently. That is a noticeable particularity.

-- Execution is stopped

-- Of course, if a multi drop view statement fails, other statements after it (create, drop, select, alter...) will not be executed, as expected.

Tested with 5.6.4-m7-log.