I have a JSON document stored in myjson table, doc column.
{
"totalResultsCount": 19,
"geonames": [
{
"geonameId": 2593109,
"fcode": "ADM1"
},
{
"geonameId": 3336899,
"fcode": "ADM1"
}, ...
When I run the query,
select j.doc.geonames.geonameId from myjson j where j.doc.geonames.fcode like '%ADM1%';
I get an array of IDs.
[2593109,3336899,3114710,2521383,3336903,2593110,3336898,3336900,2593111,3336901,2519582,2593112,3336902,3336897,3117732,6362988,2513413,3115609,2593113]
How do I read this array and print each ID using a FOR LOOP?