mysql查询json列里面具体的某个属性值

mysql版本:5.7.20

查询一层:

SELECT * FROM table WHERE JSON_EXTRACT(request_content, "$.Content") = '1'
说明:JSON_EXTRACT(列名,"$.json某个属性")

查询多层:

SELECT * FROM devices WHERE json_extract(json_extract(json_extract(json_data,"$.lastOperation"),"$.target"),"$.name") = '西门门岗闸机01'

查询多层的语句没有使用过,所以参考以下文章:

https://www.cnblogs.com/tonnytong/p/9796135.html

你可能感兴趣的:(MySQL,json)