Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of deleting views by mysql

Shulou Source: shulou.com Published: 2022-06-01 02:43:30 11月17日 Update

This article mainly introduces the method of deleting views by mysql, which is very detailed and has certain reference value. Friends who are interested must finish reading it!

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

To delete a view is to delete a view that already exists in the MySQL database. When you delete a view, you can only delete the definition of the view, not the data.

Basic grammar

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

The syntax format is as follows:

DROP VIEW [,...]

Where: specifies the name of the view to delete. The DROP VIEW statement can delete multiple views at a time, but you must have DROP permission on each view.

Delete View

[instance] Delete the v_students_info view, and enter the SQL statement and execution process as shown below.

Mysql > DROP VIEW IF EXISTS student students information OK query OK, 0 rows affected (0.00 sec) mysql > SHOW CREATE VIEW students students information exchange error 1146 (42S02): Table 'test_db.v_students_info' doesn't exist

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

These are all the contents of mysql's method of deleting views. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Views statements syntax methods content multiple data permissions formats success value interests picture names examples guys partners databases more knowledge articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Huawei MariaDB OPPO Reno Shulou Information