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

Teradata Database Teradata JSON

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1150-151K

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