このテーブルからカンマとセミコロンで区切られた文字列を生成するにはどうすればよいですか
3 つのフィールドを持つ結果テーブル
GameId(key) PlayerId(key) Rank
1 1 1
1 2 2
1 3 3
1 4 4
1 5 5
2 1 2
2 2 3
2 3 1
2 4 5
2 5 4
私が必要とする結果は、このSQLのようなものに近いです
SELECT PlayerId, count(*) as R1 from Result where Rank = 1
group by PlayerId
union
SELECT PlayerId, count(*) as R2 from Result where Rank < 5
group by PlayerId
区切られた文字列は、1,5,8;2,3,7; のようになります。これは PlayerId、R1、R2 です。