我使用https://github.com/kyleconroy/sqlc生成代码。我想使用 group_id 数组返回 human_id。
-- name: HumansByGroupID :many
SELECT human_id FROM groups
WHERE group_id IN (UNNEST($1::uuid[]));
返回
ERROR: set-returning functions are not allowed in WHERE (SQLSTATE 0A000)
在我的理解中,... IN (UNNEST($1::uuid[]));
变成IN ('...','...','...');