例: JSON_Keysを使用して、深さを指定せずにキー名を取得 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - JSONデータ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年9月
Language
日本語
Last Update
2021-03-30
dita:mapPath
ja-JP/gzn1554761068186.ditamap
dita:ditavalPath
ja-JP/gzn1554761068186.ditaval
dita:id
evi1472243742653
Product Category
Software
Teradata Vantage
次の例では、JSON_KEYSを使用してJSONオブジェクトのキー名を取得します。深さは指定されていないので、深さ全体が検索され、すべてのレベルでキーが返されます。
SELECT * from JSON_KEYS
(
ON (SELECT json_data FROM json_table))
AS json_data;
結果:
KEYS
----
“coord”
“coord”.”lon”
“coord”.”lat”
“sys”
“sys”.”country”
“sys”.”sunrise”
“sys”.”sunset”
“weather”
“weather”[0].”id”
“weather”[0].”main”
“weather”[0].”description”
“weather”[0].”icon”
“base”
“main”
“main”.”temp”
“main”.”humidity”
“main”.”pressure”
“main”.”temp_min”
“main”.”temp_max”
“wind”
“wind”.”speed”
“wind”.”deg”
“clouds”
“clouds”.”all”
“dt”
“id”
“name”
“cod”