This statement is used to drop a materialized view. Synchronous syntax
grammar:
IF EXISTS: Do not throw an error if the materialized view does not exist. If this keyword is not declared, an error will be reported if the materialized view does not exist.
table_name: The name of the table to which the materialized view to be deleted belongs. Required.
The table structure is
+----------------+-------+----------+------+------ -+---------+-------+
| IndexName | Field | Type | Null | Key | Default | Extra |
+----------------+-------+----------+------+------ -+---------+-------+
| | k2 | SMALLINT | Yes | false | N/A | NONE |
| | k3 | INT | Yes | false | N/A | NONE |
| | k4 | BIGINT | Yes | false | N/A | NONE |
| | k5 | LARGEINT | Yes | false | N/A | NONE |
| | k7 | DOUBLE | Yes | false | N/A | NONE |
| | | | | | | | |
| k1_sumk2 | k1 | TINYINT | Yes | true | N/A | |
| | k2 | SMALLINT | Yes | false | N/A | SUM |
+----------------+-------+----------+------+------ -+---------+-------+
Drop the materialized view named k1_sumk2 of the table all_type_table
+----------------+-------+----------+------+------ -+---------+-------+
+----------------+-------+----------+------+------ -+---------+-------+
| | k2 | SMALLINT | Yes | false | N/A | NONE |
| | k3 | INT | Yes | false | N/A | NONE |
| | k4 | BIGINT | Yes | false | N/A | NONE |
| | k5 | LARGEINT | Yes | false | N/A | NONE |
| | k6 | FLOAT | Yes | false | N/A | NONE |
| | k7 | DOUBLE | Yes | false | N/A | NONE |
+----------------+-------+----------+------+------ -+---------+-------+
Drop a non-existent materialized view in the table all_type_table
The delete request reports an error directly
Delete the materialized view k1_k2 in the table all_type_table, if it does not exist, no error will be reported.
drop materialized view if exists k1_k2 on all_type_table;