Home > Database > Mysql Tutorial > body text

How to use insert into statement in mysql

PHPz
Release: 2023-05-26 16:40:06
forward
2820 people have browsed it

General form of insert into statement in mysql

insert [into] 表名 [(列名1, 列名2, 列名3, ...)] values (值1, 值2, 值3, ...);
Copy after login

Three ways to write insert into statement in mysql

1. Insert a record into some fields in the original table.

insert into +表名(表中的字段,,)value(字段所对应的记录,,);
Copy after login

2. Method 1 of inserting multiple records into the fields in the original table.

insert into +表名(表中的字段,,)values(字段所对应的记录,,)(字段所对应的记录);
Copy after login

3. Method 2 of inserting multiple records into the fields in the original table.

语法:insert into+表名 select v1,v2 union all
Copy after login

The above is the detailed content of How to use insert into statement in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!