forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
3.2 KiB
3.2 KiB
Deleting a View
Function
This statement is used to delete views.
Syntax
1 | DROP VIEW [IF EXISTS] [db_name.]view_name; |
Keywords
DROP: Deletes the metadata of a specified view. Although views and tables have many common points, the DROP TABLE statement cannot be used to delete views.
Precautions
The to-be-deleted view must exist. If you run this statement to delete a view that does not exist, an error is reported. To avoid such an error, you can add IF EXISTS in this statement.
Example
To delete a view named student_view, run the following statement:
1 | DROP VIEW student_view; |
Parent topic: Views