If I put this data to jsonb field:
{'name': 'pratha', 'email': '[email protected]', 'sub': { 'id': 1 } }
I was able to select name with this query:
SELECT data_field->>'name' from users where ....
However, When they are in array, this query doesn't work:
[
{'name': 'pratha', 'email': '[email protected]', 'sub': { 'id': 1 } },
{'name': 'john', 'email': '[email protected]', 'sub': { 'id': 2 } }
]
How can I select each name in array?
See here: http://sqlfiddle.com/#!17/22166