What is a MySQL tutorial view
The English name of the view is the view is a virtual existence of the table, for the use of views of users, is basically transparent, and is a MySQL view in the database tutorial is not exist, the relevant data from the table used in the query, and is dynamically generated.
Okay, let's take a look at the database SQL view Creation
Create a view we use the permission for Creation view, and for queries and select permissions, if you use Create or replace or alert to modify the viewing chart, we also need drop permissions.
Here's a look at the syntax for view creation
create [or replace] [algorithm ={undefined |merge |temptable}]
View view_name[(column_list})
As SelectList
[With [caseaded | loca] Check OPTION]
OK, let's look at a view creation instance
->mysql>create or Replace view st_list_v as select S.st.finame from STT as s,add as a where s.addressid= As.addressi D
Query OK, 0 rows Affected (0.00 sec);
Note: The MySQL view definition has some limitations, such as, from the keyword can not be followed by a subquery, which is different from the MSSQL database, if the view migration, you may have to make some changes,
The following types of views are not updatable when the database view is updatable and the definition of the query in the view is related.
There are keyword SQL statements: Sum,min,max,count,distinct,group by Having,union,unionall mainly refers to aggregate functions
The following view is not updatable.
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 is mainly about the creation of the MySQL view and considerations for the view.
The original site reproduced the source: http://www.111cn.nethttp://www.111cn.net/database/database.html