SQL将一个表中的某一列值全部插入到另一个表中
时间:2015-05-07 10:15:04
收藏:0
阅读:533
1. SQL将一个表中的某一列值全部插入到另一个表中
插入的话:
insert into a(col) select col from b;
更新的话:
update a set col=select col from b where a.id=b.id;
判断表是否存在数据库中,存在就删除
if exists (select * from Sysobjects where name=‘temp‘)
begin
drop table temp
end
原文:http://www.cnblogs.com/jinhaoObject/p/4483886.html
评论(0)