【发布时间】:2019-10-16 02:15:26
【问题描述】:
在 postgre sql 中,我的表有下面的 json 格式的属性列
{"color": true,"view": [184],"school":
[805,812,855,856,857]}
我想写一个专栏,如果学校包含805,812,855,则为1,否则为0。下面我尝试了,但它不起作用。
case when json_extract_path_text(attributes, 'school') in
[805,812,855] then 1 else 0 end as school
我该如何解决这个问题? 谢谢。
【问题讨论】:
标签: json postgresql select contains