I've got a table field "data" with the following json:
[{"reason": "Other", "bla": 12345, "amount": "34.00", "moredata": [23, 22], "date": "2014-01-02T01:55:28.646364+00:00", "message": "Bla", "applied_to": "client"}]
And I'd like to get only the value of the json value of amount, so 34.00 in the case above in PostgreSQL.
So far I have:
substring(data from '%#"_amount_: ___.___#"%' for '#'),
Sadly this gives me "amount":"34.00", instead of just 34.00. It also doesn't work if the amount value is 9.00 or 102.00.
Any help would be appreciated.