sql - 批量插入数据

  • 直接构造
insert into t (c1, c2, c3) values (1, 1, 1), (2, 2, 2)
  • 使用UNION
insert into t (c1, c2, c3) (select a1, a2, a3) union all (select b1, b2, b3)

 

  • 利用查询结果
insert into t (c1, c2, c3) (select a1, a2, a3 from t2)

 

posted on 2014-07-13 13:39  牧之巴巴  阅读(151)  评论(0编辑  收藏  举报

导航