[, ...]". The "DROP VIEW" statement can delete multiple views at one time, but you must have DROP permission on each view."/> [, ...]". The "DROP VIEW" statement can delete multiple views at one time, but you must have DROP permission on each view.">

Home >Database >Mysql Tutorial >How to delete a view in mysql?

How to delete a view in mysql?

青灯夜游
青灯夜游Original
2020-10-12 12:30:064817browse

In mysql, you can use the "DROP VIEW" statement to delete a view. The syntax format is "DROP VIEW ea5dd2fbdee480281a8391047fa1af45 [, 11c1ebc9145b5e9169848415c92df795 ...]". The "DROP VIEW" statement can delete multiple views at one time, but you must have DROP permission on each view.

How to delete a view in mysql?

(Recommended tutorial: mysql video tutorial)

Deleting a view means deleting MySQL A view that already exists in the database. When you delete a view, only the definition of the view is deleted, but the data is not deleted.

Basic syntax

You can use the DROP VIEW statement to delete a view.

The syntax format is as follows:

DROP VIEW <视图名1> [ , <视图名2> …]

Among them: f96a157a4ed7a8435db1751107a46e3cSpecify the name of the view to be deleted. DROP VIEW statement can delete multiple views at one time, but you must have DROP permission on each view.

Delete view

[Example] Delete the v_students_info view. The input SQL statement and execution process are as follows.

mysql> DROP VIEW IF EXISTS v_students_info;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW CREATE VIEW v_students_info;
ERROR 1146 (42S02): Table &#39;test_db.v_students_info&#39; doesn&#39;t exist

You can see that the v_students_info view no longer exists and it was successfully deleted.

The above is the detailed content of How to delete a view in mysql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to open local mysqlNext article:How to open local mysql