How to drop view in SQL?
Syntax
You can drop a vie with a DROP VIEW statement. The syntax is quite simple and straightforward:
DROP VIEW [IF EXISTS] [schema_name.]view_name;
To drop multiple views at once:
DROP VIEW [IF EXISTS]
[schema_name.].view_name1,
[schema_name.].view_name2,
...
;
The IF EXIST clause prevents the query from returning the error when attempting to remove a view that does not exist.
Example:
To drop the view sales_snap:
DROP VIEW sales_snap;
Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL, and many other databases simultaneously using an intuitive and powerful graphical interface.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS