Re: extract property value from set of json arrays

2020-04-06 Thread AC Gomez
figured it out: select unnest(array_agg(e.db ->> 'e')) as j from tbl_t t cross join lateral jsonb_array_elements((t.jdata->>'b')::jsonb) as c(e) On Mon, Apr 6, 2020 at 10:51 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Apr 6, 2020 at 7:21 PM AC Gomez wrote: > >> I hav

Re: extract property value from set of json arrays

2020-04-06 Thread David G. Johnston
On Mon, Apr 6, 2020 at 7:21 PM AC Gomez wrote: > I have the following in a postgresql table > row 1: {"a": 1, "b": "[{"c": "123", "d":"456", "e": "789"}, {"c": "222", > "d":"111", "e": "000"} ]"} > row 2: {"a": 2, "b": "[{"c": "XXX", "d":"YYY", "e": "ZZZ"}, {"c": "666", > "d":"444", "e": "333"}

extract property value from set of json arrays

2020-04-06 Thread AC Gomez
I have the following in a postgresql table row 1: {"a": 1, "b": "[{"c": "123", "d":"456", "e": "789"}, {"c": "222", "d":"111", "e": "000"} ]"} row 2: {"a": 2, "b": "[{"c": "XXX", "d":"YYY", "e": "ZZZ"}, {"c": "666", "d":"444", "e": "333"} ]"} How do I pullout all "b":"e" values and end up with