数据仓库服务 GAUSSDB(DWS)-JSON/JSONB函数:jsonb_each_text(object-jsonb)

时间:2024-10-25 17:35:14

jsonb_each_text(object-jsonb)

描述:将对象的每个键值对拆分转换成一行两列。

返回类型:setof(key text, value text)

示例:

1
2
3
4
5
6
7
SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}');
 key |   value
-----+-----------
 f1  | [1, 2, 3]
 f2  | {"f3": 1}
 f4  |
(3 rows)
support.huaweicloud.com/sqlreference-dws/dws_06_0356.html