Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of deleting views by mysql

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report