将Name字段JSON解析出来
SELECT
ID,
JSON_EXTRACT(`Name`,'$.Name') AS `Name`,
JSON_EXTRACT(`Name`,'$.Age') AS Age,
JSON_EXTRACT(`Name`,'$.Sex') AS Sex
FROM test
结果展示:
去掉双引号
SELECT
ID,
JSON_UNQUOTE(JSON_EXTRACT(`Name`,'$.Name')) AS `Name`,
JSON_UNQUOTE(JSON_EXTRACT(`Name`,'$.Age')) AS Age,
JSON_UNQUOTE(JSON_EXTRACT(`Name`,'$.Sex')) AS Sex
FROM test
备注:Mysql5.7 以后版本支持JSON读取