表一的数据由我用SQL语句统计出来返回的数据集是 CID Score1
1 100
2 150
3 200表二的数据也由我用SQL语句统计出来返回的数据集是
CID Score2
1 80
2 30
3 60怎样将两个数据集合并?
合并结果例如
CID Score1 Score2
1 100 80
2 150 30
3 200 60
1 100
2 150
3 200表二的数据也由我用SQL语句统计出来返回的数据集是
CID Score2
1 80
2 30
3 60怎样将两个数据集合并?
合并结果例如
CID Score1 Score2
1 100 80
2 150 30
3 200 60
Select a.cID,a.Score1,b.Score2 From table1 a
left Join table2 b on a.cid=b.cid
create PROCEDURE [dbo].[pr_test] as
Select a.cID,a.Score1,b.Score2 From table_1 a
left Join table_2 b on a.cid=b.cid
union 是“行合并”
join 是“列合并”。
兄弟,你看错问题了。