例: 引用符なしの固有キーのリストの取得 - 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を使用して、テーブルのすべての行のすべての文書からすべての固有キーの順序付きリストを取得します。結果として返されるキー名は二重引用符で囲まれません。

SELECT distinct(JSONKeys) from JSON_KEYS
(
ON (SELECT json_data FROM json_table) USING QUOTES('N'))
AS json_data
ORDER BY 1;
結果:
JSONKeys
--------
base
clouds
clouds.all
cod
coord
coord.lat
coord.lon
dt
id
main
main.humidity
main.pressure
main.temp
main.temp_max
main.temp_min
main.temp_scale
name
sys
sys.country
sys.sunrise
sys.sunset
weather
weather[0]
weather[0].description
weather[0].icon
weather[0].id
weather[0].main
wind
wind.deg
wind.speed