I would like to query a table, orders
, anad select all rows based on a value in a json object in a column, updates
.
I want to select all rows that are within 5 days from the last time it was closed.
It is a PostgreSQL 12 database.
[
{
"time": {
"__type": "Date",
"iso": "2021-09-16T09:31:57.976Z"
},
"userId": "xKn5A1GuLV",
"to": "created",
"role": "admin"
},
{
"time": {
"__type": "Date",
"iso": "2021-09-16T09:31:57.976Z"
},
"userId": "xKn5A1GuLV",
"to": "opened",
"role": "admin",
"from": "created"
},
{
"time": {
"__type": "Date",
"iso": "2021-10-12T12:10:44.688Z"
},
"userId": "Hd37AyKJsN",
"to": "closed",
"role": "admin",
"from": "opened"
},
{
"time": {
"__type": "Date",
"iso": "2021-10-12T12:10:54.224Z"
},
"userId": "Hd37AyKJsN",
"to": "opened",
"role": "admin",
"from": "closed"
},
{
"time": {
"__type": "Date",
"iso": "2021-10-12T12:40:58.476Z"
},
"userId": "Hd37AyKJsN",
"to": "closed",
"role": "admin",
"from": "opened"
}
]