次のような結果セットがあります。
SELECT PropertyId, Owner from Table A
PropertyId Owner
1 Company A
1 Company B
I want to Pivot the result set like this:
PropertyId Owner 1 Owner 2
1 CompanyA Company B
つまり、すべての物件に 2 人の所有者が必要です。すべてのプロパティに最大 2 人の所有者がいると仮定します。