SQL method to add multiple pieces of data:
1. Add one record
insert into tableName(num1,num2,num3) values (1,2,3)
2. --Add multiple Records ①
insert into tableName(num1,num2,num3) select 3,4,5 union all //添加所有,包括重复项,使用union不添加重复项,最后一项不写union select 6,7,8
3. --Add multiple records ②
insert into tableName (num1,num2,num3) values (1,2,3), (4,3,4), (1.23,9);
The above is the detailed content of How to add multiple pieces of data in sql?. For more information, please follow other related articles on the PHP Chinese website!