【发布时间】:2013-01-30 02:50:39
【问题描述】:
我正在尝试在我的 EJB 查询中实现 dateadd。我尝试了类似的方法,但它不起作用:
select t.date + 1 from Table t
一旦我尝试执行该代码,就会出现此异常:
org.hibernate.exception.SQLGrammarException: ERROR: operator does not exist: timestamp without time zone + integer Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 93
我也尝试将 1 转换为日期和间隔,但查询结果只会为空。 我只是想知道,是否真的可以在 EJB 查询中的给定日期中添加天数
【问题讨论】: