📜  postgres array_agg 第一个元素 PIVOT - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:54.197000             🧑  作者: Mango

代码示例1
SELECT team_id, (array_agg(team_name))[1] AS teamname,
     array_agg(player_id||'##'||player_name) AS playerdetails
FROM team
INNER JOIN players ON team_id = player_team
GROUP BY team_id