1、函数查询:json_extract(json字段, '$.json属性')
select * from users where json_extract(address, '$.province') = "河北省";

2、对象操作方法进行查询:json字段->'$.json属性'
select * from users where address->'$.province' = "河北省";

1、数组操作方式查询:字段->'$[0]'
select * from users where address->'$[0]'= "家";

1、函数查询:json_length(json字段)
select * from users where json_length(address) = 2;

1、函数查询:json_length(json字段)
select * from users where json_length(address) = 2;

1、函数查询:JSON_CONTAINS(json字段,JSON_OBJECT('json数组属性', '内容'))
select * from users where JSON_CONTAINS(address,JSON_OBJECT('tags', '家'));
select * from users where address->'$[*].city' is not null;

select * from users where address->'$.tags' is not null;

到此这篇关于关于Mysql中json数据类型的查询操作指南的文章就介绍到这了,更多相关Mysql json类型数据查询内容请搜索一聚教程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持一聚教程网!