假设我有一张如下所示的表格:
Person Table
ID AccountID Name
1 6 Billy
2 6 Joe
3 6 Tom
4 8 Jamie
5 8 Jake
6 8 Sam
我有两个我知道自己工作的查询:
Select Name Group1 from person where accountid = 6
Select Name Group2 from person where accountid = 8
但我想要一个结果集看起来像这样:
Group1 Group2
Billy Jamie
Joe Jake
Tom Same