我希望你能帮助我,因为我的 sql 非常基础。以下是我的查询:
我的数据如下所示:
Policy Number | Commission Amount | Relationship | PersonLinked
50422 | 1000.00 | Owner | John Smith
50422 | 1000.00 | Advisor | Richard Bass
50422 | 1000.00 | Port Man | Craig Thomson
74857 | 500.00 | Owner | Karen Jones
98765 | 20000.00 | Owner | Tim Crosby
98765 | 20000.00 | Port Man | Josh Bishop
但我想在一行中显示所有数据,所以它看起来像这样:
Policy Number | Commission Amount | Owner | Advisor | Port Man
50422 | 1000.00 | John Smith | Richard Bass | Craig Thomson
74857 | 500.00 | Karen Jones | |
98765 | 20000.00 | Tim Crosby | | Josh Bishop
如果可以以这种方式操作数据,请告诉我 SQL 是什么。我真的被困住了。请帮忙。