在 WHERE 子句中使用集合返回函数

Using set-returning functions in WHERE clauses

SELECT * from users where server_id= and =ANY(json_object_keys(contacts));

ERROR:  set-returning functions are not allowed in WHERE

contacts 是一个 json 列,我需要在其 contacts' 键中找到具有 </code> 的行。</p> <p>联系人列示例: <code>{"90144": 0, "89915": 0}

如果 </code> 是 <code>90144,查询应该 return 在其 contacts 键中包含 90144 的每一行,如示例中所示。我怎么能做到这一点?提前致谢。

使用? operator.

SELECT * from users where server_id= and contacts::jsonb ? ;