DROP VIEW

On this page

The DROP VIEW command allows you to delete a view. This command removes the specified view, but does not affect the underlying tables that the view was based on.

Syntax

The syntax for a DROP VIEW statement is:

DROP VIEW [IF EXISTS] view_name

Parameters

  • VIEW: Keyword used to specify that a 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 view does not exist. If the IF EXISTS clause is not included and the specified view does not exist, the statement will result in an error.
  • view_name: The name of the view to be dropped.

Example

Here is an example of a DROP VIEW statement:

DROP VIEW IF EXISTS my_view

This example deletes the view my_view if it exists.

© Polypheny GmbH. All Rights Reserved.