一个包含列的表包含跟随
的数据[{"id":"1","value":"addy"},{"id":"2","value":"fname"},{"id":"3","value":"lname"},{"id":"4","value":"kfjsdkfj"},{"id":"5","value":"1985-12-02"},{"id":"6","value":"20"},{"id":"7","value":"20"},{"id":"8","value":"2"},{"id":"9","value":"20"},{"id":"10","value":"20"},{"id":"11","value":"20"},{"id":"12","value":"20"},{"id":"13","value":"1"},{"id":"14","value":"kljfk"},{"id":"15","value":"2"},{"id":"16","value":"1"},{"id":"17","value":"2"},{"id":"18","value":"3"},{"id":"19","value":""},{"id":"20","value":"1"}]
这只是一个示例数据,我有几千行像不同的值
我希望过滤此列,例如日期范围和数据范围
我试过
`SELECT *
FROM `my_table`
WHERE `my_field`
REGEXP '{"id":"15","value":"(1[0-9]|2000)"}'
`在查询条件下但是没有成功
什么正则表达式帮助我按范围找到值?
答案 0 :(得分:1)
试试吧
SELECT id FROM table_name WHERE field_name REGEXP'" key_name":"([^"] )key_word([^"] )"&#39 ;;