PostgreSQL
 sql >> Base de Dados >  >> RDS >> PostgreSQL

Precisão do carimbo de data/hora JOOQ na consulta


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