百度提交网站入口搞定设计
文章目录
- 一、查询JSON中某个属性值为XXX的数据量
 - 1、方式一
 - 2、方式二
 
- 二、查询的JSON中的value并去除双引号
 
一、查询JSON中某个属性值为XXX的数据量
1、方式一
        select count(*)from table_namewhere JSON_CONTAINS(json-> '$.filed1', '"xxx"')or JSON_CONTAINS(json-> '$.filed2', '"xxx"')
 
2、方式二
select name from data_asset_measure where JSON_EXTRACT(json, '$.filed1') = "name";
 
二、查询的JSON中的value并去除双引号
 select CAST(TRIM(BOTH '"' FROM JSON_EXTRACT(json, '$.xx')) as DECIMAL) as xxx,from table_name;
