DISTINCT is not allowed with JSON_AGG() . But you can use a subquery: SELECT b.user_id, JSON_ARRAYAGG( b.tag_id) AS tags FROM (SELECT DISTINCT b ...
確定! 回上一頁