码迷,mamicode.com
首页 > 数据库 > 详细

ACCESS批量插入

时间:2020-01-05 20:36:23      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:批量插入   tab   ble   union   muti   when   名称   rom   note   

Insert INTO 目标表(id,供应商名称,供应商地址)
Select DISTINCTROW *
FROM (Select 1 AS ID,"天鸣1" AS 供应商名称,"广东中山" AS 供应商地址  FROM MSysObjects UNION
Select 2 AS ID,"天鸣2" AS 供应商名称,"广东中山" AS 供应商地址 FROM MSysObjects UNION
Select 3 AS ID,"天鸣3" AS 供应商名称,"广东中山" AS 供应商地址 FROM MSysObjects UNION
Select 4 AS ID,"天鸣4" AS 供应商名称,"广东中山" AS 供应商地址 FROM MSysObjects)  AS tblTemp; 

Note: But the Row will be mutil when the inserting row only one. The repeat number will be reflect by the table MSysObjects.
Anybody know it‘s why?

ACCESS批量插入

标签:批量插入   tab   ble   union   muti   when   名称   rom   note   

原文地址:https://www.cnblogs.com/WaterGood/p/12153327.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!