The view Graph English name is a virtual table. For view users, it is basically transparent and the mysql view does not exist in the database, the related data comes from the tables used in the query and is dynamically generated.
What is the mysql tutorial view?
The view Graph English name is a virtual table, which is transparent to users and does not exist in the Database tutorial, the related data comes from the tables used in the query and is dynamically generated.
Okay. Let's take a look.Create Database SQL View
To create a view, we will use the create view permission and have the select permission for query and query. If we use create or replace or alert to modify the view chart, we also need the drop permission.
The syntax for creating a view is as follows:
Create [or replace] [algorithm = {undefined | merge | temptable}]
View view_name [(column_list}]
As selectlist
[With [caseaded | loca] check option]
Now let's look atView CreationInstance
-> Mysql> create or replace view st_list_v as select s. st. finame from stt as s, add as a where s. addressid = as. addressid;
Query OK, 0 rows affected (0.00 sec );
Note: the definition of the mysql view has some restrictions. For example, the from keyword cannot be followed by subqueries, which is different from that of the mssql database. If the view is migrated, some changes may be made,
Database ViewThe updatability of is related to the query definition in the view. The following types of views cannot be updated.
Keyword SQL statements: sum, min, max, count, distinct, group by having, union, and unionall mainly refer to aggregate functions.
The following views cannot be updated.
Mysql-> create or replace view palsum as select tt, sum (id) from pay group by stt;
Query OK, 0 rows affected (0.00 sec );
Well, this database view tutorial focuses on considerations for creating and viewing mysql views.
This site original tutorial reprint Indicate source: http://www.bKjia. c0m/database/database.html