Home  >  Article  >  Database  >  Can mysql handle json?

Can mysql handle json?

青灯夜游
青灯夜游Original
2020-10-05 15:17:582598browse

Mysql can handle json. To process JSON fields in Mysql, you can use the json_extract function, such as the statement "SELECT * FROM proxy WHERE json_extract(content,"$.method") = "POST";".

Can mysql handle json?

Processing JSON fields in Mysql

To process json fields, you can use the json_extract function:

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";

Convert the String value in the json field to a numeric type. You can use 0 to operate. For example,

json_extract(ext_value,'$.high')+0 highx

in the above statement will eventually become a numeric type.

Recommended tutorial: mysql video tutorial

The above is the detailed content of Can mysql handle json?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn