Json extraction using postgres

110 Views Asked by At

I have a json

{
  "timer": {
    "19272": {
      "asset_id": 9354,
      "original_total_time": 5,
      "original_warning_time": null
    }
  },
  "SEBKeys": [],
  "scoreMappings": []
}

I need to extract 'original_total_time' value from this json using Postgres.

Can anyone help?

1

There are 1 best solutions below

0
On

If your JSON structure is fixed then you can use following query

select json_->'timer'->'19272'->>'original_total_time' from test

DEMO