I have a transaction table and it has a json type field called "request".
| Field | Type | Null | Key | Default |
| id | bigint | NO | PRI | NULL |
| request | json | NO | | NULL |
| response | json | YES | | NULL |
request has two attributes currencyCode and amount.
{"amount":100000,"currencyCode":"PHP"}
I can use following mysql query to fetch these values
select json_extract(request, "$.amount") as amount, json_extract(request, "$.currencyCode") as currency from transaction;
| amount | currency |
+--------+----------+
| 100000 | PHP |
| 100000 | PHP |
| 100000 | PHP |
I want to get these values using a jooq query something like this.
DSL.select(<Tables.TRANSACTION.REQUEST.amount>, <Tables.TRANSACTION.REQUEST.currencyCode>)
.from(Tables.TRANSACTION)
.fetch()
I really appreciate if someone can help me with this.