There are two operations to get value from JSON
. The first one ->
will return JSON
. The second one ->>
will return text.
Details: JSON Functions and Operators
Try
SELECT (json_data->'position'->>'lat')::float + 1.0 AS lat
FROM updates
LIMIT 5
More Related Contents:
- Operator does not exist: json = json
- Index for finding an element in a JSON array
- Query for array elements inside JSON type
- What’s the proper index for querying structures in arrays in Postgres jsonb?
- Extract date (yyyy/mm/dd) from a timestamp in PostgreSQL
- Casting NULL type when updating multiple rows
- Double colon `::` notation in SQL
- Discard millisecond part from timestamp
- How do I cast a string to integer and have 0 in case of error in the cast with PostgreSQL?
- Referencing current row in FILTER clause of window function
- Grouped LIMIT in PostgreSQL: show the first N rows for each group?
- Possible to perform cross-database queries with PostgreSQL?
- Optimize query with OFFSET on large table
- GROUP BY and aggregate sequential numeric values
- Safely rename tables using serial primary key columns
- How to concatenate columns in a Postgres SELECT?
- How to use (install) dblink in PostgreSQL?
- PostgreSQL multi INSERT…RETURNING with multiple columns
- Postgres manually alter sequence
- Oracle equivalent of Postgres’ DISTINCT ON?
- Combine two columns and add into one new column
- Bulk/batch update/upsert in PostgreSQL
- Why is iterating through a large Django QuerySet consuming massive amounts of memory?
- Update a column of a table with a column of another table in PostgreSQL
- Check if NULL exists in Postgres array
- How to detect query which holds the lock in Postgres?
- PostgreSQL how to create a copy of a database or schema?
- PostgreSQL: fill NULL values in timeserie query with previous value
- Postgres: convert single row to multiple rows (unpivot)
- Get most common value for each value of another column in SQL