DROP MATERIALIZED VIEW
Description
This statement is used to drop a materialized view.
Privilege requirements
To drop a materialized view log, you must have the DROP TABLE privilege. For more information about seekdb privileges, see seekdb privilege types.
Syntax
DROP MATERIALIZED VIEW [IF EXISTS] materialized_view_list [opt_drop_behavior];
materialized_view_list:
[ database. ]materialized_view [,[ database. ]materialized_view]...
opt_drop_behavior:
RESTRICT | CASCADE
Parameters
| Parameter | Description |
|---|---|
| IF EXISTS | Optional. If you specify IF EXISTS, the statement will not throw an error if the materialized view does not exist. If you do not specify this option, an error will be thrown if the materialized view does not exist. |
| database. | Optional. Specifies the database where the materialized view is located. If you omit database., the materialized view will be dropped in your default database. |
| materialized_view | The name of the materialized view. |
| RESTRICT | CASCADE | Optional. Specifies the behavior of the drop operation.
|
Examples
Drop the materialized view named mv_test_tbl1 in the test_db database.
DROP MATERIALIZED VIEW mv_test_tbl1;
The return result is as follows:
Query OK, 0 rows affected (0.001 sec)