sql 将查询结果插入已存在表

insert into  #check_wl
select t1.FItemID PId,t2.FItemID,t2.FQty 
from ICBOM t1 left join ICBOMCHILD t2 on t1.FInterID =t2.FInterID where  and FUseStatus=1072 and t2.FItemID>0
union all
select  t1.FItemID PId,t2.FItemID ,t2.FQty    from ICBOM t1 left join ICBOMCHILD t2 on t1.FInterID =t2.FInterID 
where  and FUseStatus=1072 and t2.FItemID>0

union all:并联的两个查询的字段数必须一致

insert into 已存在表名
select * from tablea
union all
select * from tableb

上一篇:T2.最大回文数乘积(11.16进一步更新)


下一篇:1-5 用扑克牌计算24点