DROP VIEW(Databricks SQL)

카탈로그에서 지정된 뷰와 연결된 메타데이터를 제거합니다.

Syntax

DROP VIEW [ IF EXISTS ] view_name

매개 변수

  • IF EXISTS

    지정된 경우 뷰가 없을 때 예외가 throw되지 않습니다.

  • view_name

    삭제할 뷰의 이름입니다.

-- Assumes a view named `employeeView` exists.
> DROP VIEW employeeView;

-- Assumes a view named `employeeView` exists in the `userdb` database
> DROP VIEW userdb.employeeView;

-- Assumes a view named `employeeView` does not exist.
-- Throws exception
> DROP VIEW employeeView;
  Error: Table or view not found: employeeView;

-- Assumes a view named `employeeView` does not exist,Try with IF EXISTS
-- this time it will not throw exception
> DROP VIEW IF EXISTS employeeView;