【发布时间】:2015-04-20 18:15:43
【问题描述】:
我遇到了异常
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: dayofweek near line 1, column 155
下面是我查询表的函数
Session session = getSession();
Query query = session.createQuery("select count(tex.task.id)" + " from " + TestExecution.class.getName() + " tex where tex.userId=:userId and " +
"tex.executedAt >= curdate()- interval dayofweek(curdate())+6 day and tex.executedAt < curdate() - interval dayofweek(curdate())-1 DAY");
query.setParameter("userId", userId);
return (long) query.uniqueResult();
请帮帮我..
【问题讨论】:
-
这个“dayofweek”到底是什么意思,“interval”和“dayofweek”之间不应该有什么符号吗?
标签: java mysql sql database hibernate