Home >Database >Mysql Tutorial >Detailed explanation of mysql view instance
View: It is a select statement (usually more complex). We give it a name (view name). In the future, it is convenient to use (execute) the select statement: just use the view name. (Similar to the encapsulation and calling of functions)
Grammar form:
create view 视图名 【(字段名1,字段名2,字段名3,....)】 as select语句;
Example:
Example:
Usually used as a table
drop view 【if exists】 视图名;
Related recommendations:
Introduction to mysql views and why views are used and their rules and restrictions
Detailed explanation of the role of MySQL views (2)-Filter data, calculate fields, and update views
The above is the detailed content of Detailed explanation of mysql view instance. For more information, please follow other related articles on the PHP Chinese website!