So I have a column within my database called divisions that lives on the company table. using a simple SELECT divisions FROM companies; I get the division rows of course
{"{\"id\": \"c88c8cf6-4b23-4575-a99f-1da966ad68a4-ceo\", \"title\":
\"CEO\", ... }"}
What I need to do is return just one field of each JSONB, title for example.
I have tried various methods to do this, the closest I can find seems to be
SELECT json_array_elements(divisions->>'title'::jsonb) FROM companies;
but this gives back the error
ERROR: invalid input syntax for type json
LINE 1: SELECT json_array_elements(divisions->>'title'::jsonb) FROM ...
^
DETAIL: Token "title" is invalid.
any idea?