Home > Database > Mysql Tutorial > body text

Can mysql handle json?

青灯夜游
Release: 2020-10-05 15:17:58
Original
2570 people have browsed it

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";
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!