我正在使用将数据插入数据库json_encoded。现在,我要搜索“功能”,但不能。MySQL查询:SELECT `id` , `attribs_json` FROM `products` WHERE `attribs_json` REGEXP '"1":{"value":[^"3"$]'该查询向我显示所有键为“ 1”且值是任何东西而不是“ 3”的行我的数据是:{"feature":{"1":{"value":"["2","3"]"}, "2":{"value":["1"]}, "5":{"value":""}, "3":{"value":["1"]}, "9":{"value":""}, "4":{"value":"\u0633\u0627\u062a\u0646"}, "6":{"value":""}, "7":{"value":""}, "8":{"value":""} },"show_counter":"0","show_counter_discount":""}}
3 回答
慕姐8265434
TA贡献1813条经验 获得超2个赞
如果您使用的是MySQL最新版本,则可以帮助您满足要求。
select * from products where attribs_json->"$.feature.value[*]" in (1,3)
添加回答
举报
0/150
提交
取消