mysql能处理json。Mysql中处理JSON字段,可以用json_extract函数,例“SELECT * FROM proxy WHERE json_extract(content,"$.method") = "POST";”语句。
Mysql中处理JSON字段
处理json字段,可以用json_extract函数:select * from (select json_extract(ext_value,'$.high')+0 highx,batch_id from batch_ext_1 where ext_type=19 ) a where a.highx>15000000000
SELECT * FROM proxy WHERE json_extract(content,"$.method") = "POST";
将json字段中的String值转为数字型,可以用+0操作,比如上面语句中json_extract(ext_value,'$.high')+0 highx
最终会变成数字型。