Answer by a_horse_with_no_name for Extract JSON array of numbers from JSON...
You need to first unnest the array elements, and then aggregate back each value:select id, (select jsonb_agg(t -> 'a') from jsonb_array_elements(record) as x(t)) as recordfrom the_table;Online...
View ArticleExtract JSON array of numbers from JSON array of objects
I have a table containing a json array of objects similar to this:id | record____________________name1 | [{"a":0, "b":x}, {"a":1, "b":y}, {"a":2, "b":z}, ...]I would like to get a table containing a...
View Article
More Pages to Explore .....