Home > Daily Programming > Mysql Knowledge > How to update data in Mysql data table view

How to update data in Mysql data table view

藏色散人
Release: 2019-05-21 19:52:37
Original
9827 people have browsed it

This article mainly introduces you to the update operation of data in the view in the mysql data table.

Recommended related mysql video tutorials: "mysql tutorial"

The definition of mysql data table view and related operations, such as query, modification, deletion, addition, etc. The operation introduction has been explained in detail to you in our recently published article, so I will not introduce it one by one here. Newbies who need to know more can refer to relevant articles.

How to query the view in the mysql data table

How to modify the view in the Mysql data table

[How to delete the view in the mysql data table

How to delete the data in the mysql data table view

The main content of this section The content is the update operation of the view. The so-called update operation refers to updating (changing, replacing...) the data in the basic table through the view. Since the view is a virtual table with no real data in it, when we update the data through the view, we are actually updating the data in the MySQL basic table. For example, adding, deleting, and modifying the view means updating the basic table data. Perform addition, deletion and modification operations, but there will be certain restrictions on view operations.

Below we will continue to introduce you to the related operations of updating data in the MySQL data table view based on simple examples.

How to update data in Mysql data table view?

First we can query the single table view data (my_v1). As shown in the figure below, there are six pieces of data for my_v1.

How to update data in Mysql data table view

Then we update the data in my_v1 through the update statement. Here we update the namename field value with id 3 from "232" to "oyk" .

How to update data in Mysql data table view

As shown in the picture query OK means the update is successful. We can check whether the update is successful through Navicat.

How to update data in Mysql data table view

#As shown in the figure, the data in the single table view my_v1 was successfully updated.

Note:

Not all views can be updated. Row and column subset views of base tables are generally updateable. However, if the attributes of the view come from aggregate functions and expressions, the view must not be updated, and if the view is derived from more than two base tables, the view is usually not allowed to be updated!

This article is an introduction to the update operation of view data in the mysql data table. It is simple and easy to understand. I hope it will be helpful to friends in need!

If you want to know more about mysql, you can follow the PHP Chinese website mysql video tutorial, everyone is welcome to refer to and learn!

The above is the detailed content of How to update data in Mysql data table view. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template