- 论坛徽章:
- 0
|
这个是在mysql 使用命令可以执行的语句:
select count(*) from job_info where job_status >= 40 and now() > date_add(publish_time,INTERVAL 30 DAY)
下面这个是我在java程序中使用的 hql 语句
select count(*) from JobInfo where JobStatus >= 40 and now() > date_add(publish_time,INTERVAL 30 DAY)
可是第二个是报错的:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: 30 near line 1, column 120 [
是date_add 在hql 语句中使用的出错的,我该怎么解决呢?
注:我是改的从前别人写的代码,因为这个日期条件只是一个大hsql的一部分,所以,我不能使用jdbc,或者是hibernate 执行sql语句的方式,因为我不确定到底都有谁调用了这部分。
在hsql 里面怎样使用mysql 的date_add 函数呢?? |
|