代码如下:
use DBTEST
select * from sf1
select * into test1 from sf1
--将dp、id导入到test2中去
select dp,id into test2 from test1
select * from test2
--将pr、id 导入到test3中去
select pr,id into test3 from test1
select * from test3
--将xh、name导入到test4中去
select xh,name into test4 from test1
select * from test4
--列的合并
select test2.id,test3.pr,test2.dp into test5 from test2 cross join test3 where test2.id=test3.id
select * from test5
--列的合并的简化
select a.id,b.pr,a.dp into test6 from test2 a cross join test3 b where a.id=b.id
select * from test6