日期:2014-05-17  浏览次数:20379 次

表复制相关
a表 (code,col2,col3)
b表 (code,col5,col6)
a.code与b.code是关联字段,
b表数据多于a表数据,
我希望将b表多于a表的数据复制到a表里面,
谢谢
------解决方案--------------------
insert into a表(code,col2,col3)
select code,col5,col6 from b表 where not exists(
 select top(1)1 from a表 where a表.code=b表.code
)