15.10 - Example: Use ExistValue to Check for a Specific Child - Teradata Database

Teradata Database Teradata JSON

Product
Teradata Database
Release Number
15.10
Published
December 2015
Language
English (United States)
Last Update
2018-06-05
dita:mapPath
TeradataJSON_15_10.ditamap
dita:ditavalPath
ft:empty

The following query results in 'True' if the JSON column contains a child named 'schools' which is an array, and the second element of the array has a child named 'type'.

SELECT eno, 'True'
FROM my_table
WHERE edata.ExistValue('$.schools[1].type') = 1;

Result:

   ENO    'True'
------------------
   1      True