【Vegas原创】将一个表的几个栏位数据插入到另一个表的栏位中
use vegas
insert into user_list (login_name,dept,active)
select login_name,dept_code,active from flower.dbo.am_employee where dept_code='SC00'
use vegas
select * from user_list
use flower
select * from am_employee
select count(login_name) from user_list group by login_name
select distinct login_name,dept,active into #temp from user_list
select * from #temp
truncate table user_list
insert into user_list (login_name,dept,active)
select * from #temp
drop table #temp
insert into user_list (login_name,dept,active)
select login_name,dept_code,active from flower.dbo.am_employee where dept_code='SC00'
use vegas
select * from user_list
use flower
select * from am_employee
select count(login_name) from user_list group by login_name
select distinct login_name,dept,active into #temp from user_list
select * from #temp
truncate table user_list
insert into user_list (login_name,dept,active)
select * from #temp
drop table #temp
喜欢请赞赏一下啦^_^