1、如果只有一級json,可以用A->'$.B'的方式提取
等同於json_extract(A,'$.B') ===> extend_info = {"age":1089,"name":"tom"}
例如: select json_extract(extend_info,'$.name') as age from dfcv_vps_plus_api_vehicle_monitor_terminalstatus where chassis_new ='N9002199'
結果: "tom"
例如: select area_code->'$.name' as age from dfcv_vps_plus_api_vehicle_monitor_terminalstatus where chassis_new ='N9002199';
結果: "tom"
2、可以用json_unquote()去掉引號
例如: select json_unquote(json_extract(area_code,'$.name')) as age from dfcv_vps_plus_api_vehicle_monitor_terminalstatus where chassis_new ='N9002199'
結果: tom (去掉了雙引號)
3、如果是json數組,
A->'$.B'->'$.C'這樣的方式就不行了,反正我試了就是取不到,報語法錯誤,可以用下面這種方式
json_extract(json_extract(A,'$.B'),'$.C')
在用 json_unquote去掉引號