mysql中JSON_EXTRACT()函数

JSON_EXTRACT()函数
在mysql5.6中不支持

使用方式
json_test 需要查询数据的表

SELECT
    id,
    json_extract( t.jsonstr, '$.*' ),
    json_extract( t.jsonstr, '$.title' ) AS "title",
    json_extract( t.jsonstr, '$.content' ) AS "content" ,
    json_extract( t.jsonstr, '$**.text' ) AS "text" ,
    json_extract( t.jsonstr, '$.content[*].item1[*]' ) AS "item1" 
FROM
    json_test t;

猜你喜欢

转载自blog.csdn.net/qq_44379042/article/details/121329594