DROP VIEW

적용 대상: 예(예)로 표시된 확인 Databricks SQL 예(예)로 표시된 확인 Databricks 런타임

카탈로그에서 지정된 뷰와 연결된 메타데이터를 제거합니다. 보기를 삭제하려면 뷰가 있는 소유자 또는 스키마, 카탈로그 또는 메타스토어의 소유자여야 합니다.

구문

DROP [ MATERIALIZED ] VIEW [ IF EXISTS ] view_name

매개 변수

예제

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

-- Assumes a view named `employeeView` exists in the `usersc` schema
> DROP VIEW usersc.employeeView;

-- Assumes a view named `employeeView` does not exist.
-- Throws TABLE_OR_VIEW_NOT_FOUND
> DROP VIEW employeeView;
  [TABLE_OR_VIEW_NOT_FOUND]

-- Assumes a materialized view named `employeeView` exists.
> DROP MATERIALIZED VIEW 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;