If you want to insert 5 records into table1, the following is wrong: INSERT INTO table1 (id,name) VALUES(1,Xiaoming,2,Xiaoqiang,3,Xiaodu,4,Xiaoli,5,Xiaobai); MySQL will throw the following error ERROR 1136: Column count doesn't match value count at row 1 The correct way to write it should be like this: INSERT INTO table1(i,name) VALUES(1,'Xiao Ming'),(2,'Xiao Qiang'),(3,'Xiao Du'),(4,'Xiao Li'),(5,'Xiao Bai'); Of course, you can also omit the column name in this way, so the number of values in each pair of brackets must be the same, and this number must be consistent with the number of columns. like: INSERT INTO table1 VALUES(1,'Xiao Ming'),(2,'Xiao Qiang'),(3,'Xiao Du'),(4,'Xiao Li'),(5,'Xiao Bai'); Summarize The above is what I introduced to you about using insert in Mysql to insert multiple records in batches of new data. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: How to Set Shortcut Icons in Linux
>>: js to upload pictures to the server
Some web pages may not look large but may be very ...
Why use prettier? In large companies, front-end d...
MySQL creates users and authorizes and revokes us...
Configuring network connectivity for Linux system...
Ubuntu 16.04 builds FTP server Install ftp Instal...
Table of contents 1. Basic knowledge of indexing ...
In life, the Internet is everywhere. We can play ...
Secondly, the ranking of keywords is also related ...
Table of contents 1. Introduction 2. Prepare the ...
Today, when I was installing CentOS6.2, I couldn&...
Table of contents 1. The significance of users an...
Table of contents About Kubernetes Basic environm...
In the previous article, we wrote about how to de...
Delayed loading (lazy loading) and preloading are...
HTML reuse is a term that is rarely mentioned. Tod...