doc-exports/docs/dli/sqlreference/dli_08_0131.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
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>
2024-03-27 22:02:33 +00:00

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;