MySQL JSON 数组条件搜索

2022-05-04  本文已影响0人  承诺一时的华丽
JSON数据字段:

{"DY_houseCheck":[1],"DY_carCheck":[1],"DY_carTypeCheck":[1],"DY_house":["有"],"DY_car":["无"],"DY_carType":["按揭"]}

查询字段JSON中的属性
select describe_where,JSON_QUERY(describe_where, '$.DY_houseCheck') from product

select JSON_QUERY(describe_where, '$.DY_houseCheck') from product WHERE JSON_CONTAINS(JSON_QUERY(describe_where, '$.DY_houseCheck'),'1')

describe_where字符串数组包含查询
select  * from expert where   json_contains(describe_where,CONCAT('"',"22",'"'))
上一篇下一篇

猜你喜欢

热点阅读