Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table test (data jsonb);
- insert into test (data) values ('{"id": 1, "items":[{"a": 1, "b": 2}, {"a":3, "b": 4}]}');
- insert into test (data) values ('{"id": 2, "items":[{"a": 2, "b": 3}, {"a":4, "b": 5}]}');
- select * from test;
- data
- ----------------------------------------------------------
- {"id": 1, "items": [{"a": 1, "b": 2}, {"a": 3, "b": 4}]}
- {"id": 2, "items": [{"a": 2, "b": 3}, {"a": 4, "b": 5}]}
- (2 rows)
- Looking for:
- id | a | b
- ----------
- 1 | 1 | 2
- 1 | 3 | 4
- 2 | 2 | 3
- 2 | 4 | 5
- Ideally creating a view into the db.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement