I have an JSONB array in postgres in the follow format.
{
"id" : 22323,
"details" : [
{
"status" : "stage1",
"timestamp" : "2017-09-89"
},
{
"status" : "stage2",
"timestamp" : "2017-09-89"
}
]
}
I need to get the timestamp at stage2, how do I select the particular status's timestamp in postgresql ?
"status": "stageVALUE, you can justuse ->element, but if not - you need to iterate over elements of array withjson_array_elementsselect (json_column ->> 'details')::json ->> status from tableand it didn't work. I got empty results.