将子查询中的多个值插入表的列

时间:2017-01-09 07:40:02

标签: sql sql-server

我想从子查询中插入值

我的查询就是那样..

insert into T_Scanned(F_Asset_Code) values (select F_Barcode from T_Assets where F_Barcode
in(  select Barcode as barcoade  from  [T_NEWASSET]))

但这不起作用......

1 个答案:

答案 0 :(得分:4)

执行VALUES

时,您无需使用INSERT INTO ... SELECT
insert into T_Scanned(F_Asset_Code) 
select F_Barcode from T_Assets where F_Barcode
in(  select Barcode as barcoade  from  [T_NEWASSET])