PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

JOOQ Precisione del timestamp sulla query

Usa DSL.trunc(Field, DatePart) , cioè

Result<Record1<Timestamp>> result = createQueryBuilder()
    .selectDistinct(trunc(incomeTable.REF_DATE, DatePart.DAY).as("refdate"))
    .from(incomeTable)
    .where(incomeTable.PROBOS_ID.eq(probosId))
    .fetch();