skip to Main Content

Postgresql – Extract values from multiple nested arrays in a JSONB column

I'm currently working on a PostgreSQL query to extract specific values from a JSONB column. Here's the query I'm using: select a.id, (jsonb_array_elements(a.info->'attribute1')->>'value') as attribute1, (a.info->>'attribute2') as attribute2, (a.info->>'attribute3') as attribute3, (jsonb_array_elements(a.info->'attribute4')->>'value') as attribute4 from a_table a where (cast(a.info->>'attribute3' as…

VIEW QUESTION
Back To Top
Search