> "Andrew" == Andrew Gierth writes:
> "Rory" == Rory Campbell-Lange writes:
Rory> and data like this:
Rory> j
Rory> --
Rory> {"a": 1, "people": [{"id": 2002}, {"id": 2004}]}
Rory> {"a": 3, "people": [{"id": 200
> "Rory" == Rory Campbell-Lange writes:
Rory> and data like this:
Rory> j
Rory> --
Rory> {"a": 1, "people": [{"id": 2002}, {"id": 2004}]}
Rory> {"a": 3, "people": [{"id": 20
Rory Campbell-Lange writes:
> ... I can't work out how to return the whole row containing a desired
> people id value.
Something like this, maybe?
=# select * from x where
'2003'::jsonb in (select jsonb_array_elements(j #>'{people}')->'id');
j
-