I have the following column in my database which is a postres jsonb object. I am just trying to fetch the value of additional_data from mytable which has the json string in it.
select additional_data from mytable;
{"latitude":"123", "longitude":"234"}
{"latitude":"567", "longitude":"890"}
i'm just trying to get the value of latitude for my query and I am unable to figure out how the exact syntax would need to be for this. I tried to do the following
select latitude->>'additional_data' from mytable;
select latitude->'additional_data' from mytable;
select latitude#>>'additional_data' from mytable;
but when I do this, I get the following error
SQL Error [42703]: ERROR: column "latitude" does not exist
Position: 8
but that column definitely exists. Not sure what I am doing wrong.
SELECT additional_data->>'latitude' FROM mytable;