[, ...]". 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>Article>Database> What is the sql statement to delete a view?

What is the sql statement to delete a view?

青灯夜游
青灯夜游 Original
2021-02-04 16:36:43 24652browse

The SQL statement to delete a view is "DROP VIEW", and the specific 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.

What is the sql statement to delete a view?

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

Deleting a view refers to deleting an existing view in the MySQL database. When you delete a view, only the definition of the view is deleted, but the data is not deleted.

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. The DROP VIEW statement can drop multiple views at once, but you must have DROP permission on each view.

Example: Delete the students_info view

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

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

For more knowledge about computer programming, please visit:Introduction to Programming! !

The above is the detailed content of What is the sql statement to delete a view?. 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