1

JOOQ's Date docs contain the usual date functions (to_date, dateadd, ect..). However, I couldn't find any docs explaining how to use SQL's INTERVAL type to perform date math.

Can this SQL be represented in JOOQ or is my only option to dip down into raw SQL?

to_date(my_date_col) - INTERVAL '1 MONTH'
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509

1 Answers1

0

Use any of these

TABLE.MY_DATE_COL.minus(new YearToMonth(0, 1));
DSL.dateSub(TABLE.MY_DATE_COL, new YearToMonth(0, 1));
DSL.dateSub(TABLE.MY_DATE_COL, 1, DatePart.MONTH);
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509