-2

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?

Akhilesh Mishra
  • 5,876
  • 3
  • 16
  • 32

1 Answers1

0

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

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

DEMO

Akhilesh Mishra
  • 5,876
  • 3
  • 16
  • 32