数据仓库服务 GAUSSDB(DWS)-JSON/JSONB函数:json_typeof(json)

时间:2024-01-26 16:15:25

json_typeof(json)

描述:检测json类型。

返回类型:text

示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
SELECT value, json_typeof(value) from (values (json '123.4'), (json '"foo"'), (json 'true'), (json 'null'), (json '[1, 2, 3]'), (json '{"x":"foo", "y":123}'), (NULL::json)) as data(value);
        value         | json_typeof
----------------------+-------------
 123.4                | number
 "foo"                | string
 true                 | boolean
 null                 | null
 [1, 2, 3]            | array
 {"x":"foo", "y":123} | object
                      |
(7 rows)
support.huaweicloud.com/sqlreference-820-dws/dws_06_0356.html