数据湖探索 DLI-字符串函数:JSON_VALUE
JSON_VALUE
- 功能描述
- 语法
VARCHAR JSON_VALUE(VARCHAR content, VARCHAR path)
- 参数说明
- content:输入字符串。
- path:要获取的path路径。
- 示例
- 测试语句
SELECT JSON_VALUE(content, path) AS case_result FROM T1;
- 测试数据和结果
表9 测试数据和结果 测试数据(content,path)
测试结果(case_result)
{ "a1":"v1","a2":7,"a3":8.0,"a4": {"a41":"v41","a42": ["v1","v2"]}}
$
{ "a1":"v1","a2":7,"a3":8.0,"a4": {"a41":"v41","a42": ["v1","v2"]}}
{ "a1":"v1","a2":7,"a3":8.0,"a4": {"a41":"v41","a42": ["v1","v2"]}}
$.a1
v1
{ "a1":"v1","a2":7,"a3":8.0,"a4": {"a41":"v41","a42": ["v1","v2"]}}
$.a4
{"a41":"v41","a42": ["v1","v2"]}
{ "a1":"v1","a2":7,"a3":8.0,"a4": {"a41":"v41","a42": ["v1","v2"]}}
$.a4.a42
["v1","v2"]
{ "a1":"v1","a2":7,"a3":8.0,"a4": {"a41":"v41","a42": ["v1","v2"]}}
$.a4.a42[0]
v1
- 测试语句
- GaussDB数据库函数和字符串_高斯数据库优势_新建高斯数据库_高斯协议
- 什么是数据湖探索服务_数据湖探索DLI用途与特点
- GaussDB函数_GaussDB数据库函数_高斯数据库函数_华为云
- GaussDB支持的函数_GaussDB函数类型解析_高斯数据库支持的函数-华为云
- 调用函数_函数调用方式_函数工作流 FunctionGraph-华为云
- GaussDB数据库函数_GaussDB函数和操作符_高斯数据库函数-华为云
- GaussDB数据库函数_GaussDB介绍_高斯数据库函数
- 什么是函数工作流_函数托管计算服务_函数工作流 FunctionGraph-华为云
- 使用容器镜像部署函数_函数部署_函数工作流 FunctionGraph-华为云
- 如何使用模板创建函数_模板创建函数_函数工作流 FunctionGraph-华为云