New versions: Dev (3.14) | Latest (3.13) | 3.12 | 3.11 | 3.10

LOCALDATESUB

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Subtract an interval of type java.lang.Number (number of days) or org.jooq.types.Interval (SQL interval type) from a date (represented by java.time.LocalDate).

This does the same as DATESUB except that the client type representation uses JSR-310 types.

SELECT DATE '2020-02-03' + 2;
create.select(localDateSub(Date.valueOf("2020-02-03"), 2)).fetch();

The result being

+------------+
| date_sub   |
+------------+
| 2020-02-01 |
+------------+
The jOOQ Logo