在单个SQL查询中插入多行? [重复]

北慕城南 提交于 2020-08-18 05:46:36

问题:

I have multiple set of data to insert at once, say 4 rows. 我有一组数据要一次插入,比如4行。

My table has three columns: Person , Id and Office . 我的表有三列: PersonIdOffice

INSERT INTO MyTable VALUES ("John", 123, "Lloyds Office");
INSERT INTO MyTable VALUES ("Jane", 124, "Lloyds Office");
INSERT INTO MyTable VALUES ("Billy", 125, "London Office");
INSERT INTO MyTable VALUES ("Miranda", 126, "Bristol Office");

Can I insert all 4 rows in a single SQL statement ? 我可以在一个SQL statement insert所有4行吗?


解决方案:

参考一: https://stackoom.com/question/1toB/在单个SQL查询中插入多行-重复
参考二: https://oldbug.net/q/1toB/Inserting-multiple-rows-in-a-single-SQL-query-duplicate
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!