本帖最后由 永洪tech-man 于 2018-2-28 18:07 编辑
例如:字段名 firstname,类型为 字符串 ,值 为 {"num": 123,"arr": [1, 2],"obj":{"a": 3,"b": 4}}
sql写法如下: select firstname->'$.num' as num, -- 123
firstname->'$.arr' as arr, -- [1,2]
firstname->'$.arr[1]' as arr1, -- 2
firstname->'$.obj.a' as a -- 3
from table_name
json数据其他操作参考 http://www.jb51.net/article/89219.htm
|