I wrote the following query statement using PostgreSQL, then called the PostgreSQL statement with an API, and when I clicked those two buttons, an error occurred.
SELECT
u.username,
g.name AS group_name
FROM
Users u
JOIN
Groups g
ON
u.primary_group_id = g.id
WHERE
u.username = ‘yangxuan’
SELECT
username,
array_agg(id) AS ids
FROM
Users
GROUP BY
username
HAVING
COUNT(id) > 1;