I need to update id=2 when id=46 - probably using CASE expression as I have multiple objects with different values.
select q.a from (select json_array_elements_text('[{"id":46,"value":"a"},{"id":35,"value":"b"}]'::json) as a)q.
Also, why do I get the error "operator does not exist: text ->> unknown" when trying to run:
select q.a from (select json_array_elements_text('[{"id":46,"value":"a"}]'::json) as a)q where a->>'id'=46
Just want to understand what I am missing.