【发布时间】:2019-10-16 13:42:04
【问题描述】:
我正在尝试将以下 PostgreSQL 查询转换为 jOOQ:
SELECT count(*), to_char(created_date, 'YYYY-MM-DD') as year_month_date
FROM log
GROUP BY year_month_date
ORDER BY year_month_date
我拥有的是:
jooq.select(
DSL.count(),
DSL.field("to_char(created_date, 'YYYY-MM-DD') as year_month_date")
)
.from(LOG)
.groupBy(DSL.field("year_month_date"))
.orderBy(DSL.field("year_month_date"))
.fetch();
有没有办法使用 jOOQ 的 fluent API,这样我就不必使用字符串了?
【问题讨论】: