我已经在 mysql DB 中插入了json encoded
数据类型的记录,现在我必须在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":""
}}