我正在使用将数据插入数据库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":""
}}