DROP MATERIALIZED VIEW command allows you to delete a materialized view. This command removes the specified materialized view, but does not affect the underlying tables that the materialized view was based on.
The syntax for a
DROP MATERIALIZED VIEW statement is:
DROP MATERIALIZED VIEW [IF EXISTS] view_name
MATERIALIZED VIEW: Keyword used to specify that a materialized view should be dropped.
IF EXISTS: This is an optional clause. If the
IF EXISTSclause is included, the statement will not return an error if the specified materialized view does not exist. If the
IF EXISTSclause is not included and the specified materialized view does not exist, the statement will result in an error.
view_name: The name of the materialized view to be dropped.
Here is an example of a
DROP MATERIALIZED VIEW statement:
DROP MATERIALIZED VIEW IF EXISTS my_materialized_view
This example deletes the materialized view
my_materialized_view if it exists.