I would like to implement a basic time_bucket statement in JOOQ.
If I run this Statement in the console it works perfekly fine:
SELECT time_bucket('5 minutes', time) as t, avg(average)
from TABLE
GROUP BY t
If i try to implement it with JOOQ I have the Problem that the generated routines do not work, because I cannot add the intervals.
I want something like the following code, but the Interval '5 minutes' doesn't work:
dslContext.select(timeBucket('5 minutes', TABLE.TIME), avg(TABLE.AVERAGE))
.from(TABLE)
.groupBy(timeBucket8('5 minutes', TABLE.TIME))
.fetch())
Is there a simple way to implement the Intervals?