Home > Database > Mysql Tutorial > How to create a view in mysql? What is a create statement?

How to create a view in mysql? What is a create statement?

青灯夜游
Release: 2020-10-13 16:11:52
Original
19542 people have browsed it

In mysql, you can use the "CREATE VIEW" statement to create a view. The syntax format is "CREATE VIEW AS " cannot contain subqueries in the FROM clause and cannot reference prepared statement parameters. 语句>语句>

How to create a view in mysql? What is a create statement?

(Recommended tutorial: mysql video tutorial)

Creating a view refers to establishing a view on an existing MySQL database table. Views can be created in one table or in multiple tables.

Basic syntax

You can use the CREATE VIEW statement to create a view.

The syntax format is as follows:

CREATE VIEW <视图名> AS <SELECT语句>
Copy after login

The syntax description is as follows.

  • : Specify the name of the view. The name must be unique in the database and cannot have the same name as another table or view.