Home > Database > Mysql Tutorial > body text

Detailed explanation of mysql view instance

小云云
Release: 2018-03-15 10:45:42
Original
1416 people have browsed it

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)

Create a view

Grammar form:

create  view  视图名 【(字段名1,字段名2,字段名3,....)】   as   select语句;
Copy after login

Example:

Detailed explanation of mysql view instance

Using views

Example:

Usually used as a table

Detailed explanation of mysql view instance

Delete view:

drop  view  【if  exists】 视图名;
Copy after login

Related recommendations:

Introduction to mysql views and why views are used and their rules and restrictions

Detailed explanation of the role of MySQL views (1) -Simplify complex connections and format retrieved data

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!

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