赞
踩
get_json_object() (每次只能查一个字段)
json字段 :json_data = '{"name":"jack","server":"www.qq.com"}'
输入:select get_json_object( json_data , '$.server');
输出:www.qq.com
可以使用嵌套:
json字段 :json_data = '{"shop":{"book":[{"price":43.3,"type":"art"},{"price":30,"type":"technology"}],"clothes":{"price":19.951,"type":"shirt"}},"name":"jane","age":"23"}'
输入:select get_json_object( json_data , '$.shop.book[0].type');
输出:art
json_tuple(可以查多个字段,但使用不了嵌套)
json字段 :json_data = '{"name":"jack","server":"www.qq.com"}'
输入:select json_tuple( json_data , 'server' , 'name');
输出:www.qq.com jack
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。