DROP MATERIALIZED VIEW

On this page

The 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.

Syntax

The syntax for a DROP MATERIALIZED VIEW statement is:

DROP MATERIALIZED VIEW [IF EXISTS] view_name

Parameters

  • MATERIALIZED VIEW: Keyword used to specify that a materialized view should be dropped.
  • IF EXISTS: This is an optional clause. If the IF EXISTS clause is included, the statement will not return an error if the specified materialized view does not exist. If the IF EXISTS clause 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.

Example

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.

© Polypheny GmbH. All Rights Reserved.