此处拼装批量插入语句。
mysql
insert into demo (id, name)
select '11','22' union
select '33','44'
oracle
insert into demo (id, name)
select '11', '22' from dual union all
select '33', '44' from dual
demo:表明
id,name 字段
你懂得
本文介绍了在MySQL和Oracle数据库中使用批量插入数据的方法。通过构造特定的SQL语句,可以有效地提高数据插入效率。示例展示了如何利用UNION和UNION ALL进行多条记录的同时插入。
此处拼装批量插入语句。
mysql
insert into demo (id, name)
select '11','22' union
select '33','44'
oracle
insert into demo (id, name)
select '11', '22' from dual union all
select '33', '44' from dual
demo:表明
id,name 字段
你懂得
转载于:https://my.oschina.net/u/2764409/blog/715787
4万+

被折叠的 条评论
为什么被折叠?