Hql group by unexpected AST node
来源:互联网 发布:网络消费者的购物流程 编辑:程序博客网 时间:2024/06/05 11:16
如果按下面的格式写
则会抛如下的错误:
unexpected AST node: > near line 1, column 243 [SELECT CASE WHEN addTime> 1449555508 THEN Min(addTime) WHEN addTime< 1449555508 THEN MAX(addTime) END as addTime FROM BrandColumn WHERE addTime<> 1449555508 and type=2 GROUP BY addTime>1449555508]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: > near line 1, column 243 [SELECT CASE WHEN addTime> 1449555508 THEN Min(addTime) WHEN addTime< 1449555508 THEN MAX(addTime) END as addTime FROM BrandColumn WHERE addTime<> 1449555508 and type=2 GROUP BY addTime>1449555508]
经过查资料,才知道HQL里面的group by不能包含算数表达式
改成如下:
则正确了。
相关链接:http://blog.csdn.net/chenssy/article/details/7728367
0 0
- Hql group by unexpected AST node
- unexpected AST node: query
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token 的解决
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line
- org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree []
- HQL Group By Clause Example
- hql group by使用 (HibernateCallback())
- HQL子查询报错:org.hibernate.hql.ast.QuerySyntaxException: unexpected token...
- hibernate之HQL之group by子句
- 相当相当隐蔽的错误 org.hibernate.hql.ast.QuerySyntaxException: unexpected token
- Hibernate error : org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 3解决方法
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1解决方案
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 16
- 相当相当隐蔽的错误 org.hibernate.hql.ast.QuerySyntaxException: unexpected token
- ERROR org.hibernate.hql.internal.ast.ErrorCounter (ErrorCounter.java:73) :unexpected token: tar错误解决
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: from near line 1, column 17 [select co
- ERROR org.hibernate.hql.internal.ast.ErrorCounter unexpected token: form解决方法
- Java调用Kettle执行任务或转换
- SQL SERVER数据库备份时出现“操作系统错误5(拒绝访问)。”错误的解决办法
- PHP Memcache详解
- poi 单元格内容换行
- Win10无法重置
- Hql group by unexpected AST node
- new String(getBytes(ISO-8859-1),GBK)解决中文乱码问题分析
- ubuntu14.04 and apache2 添加自己的web应用,403 forbidden
- eerTyraniBdecnalaB.110
- 关于 “does not contain bitcode.”的错误解决办法
- Android Studio配置svn时提示需要证书:authentication required的解决方法
- String和StringBuffer的相互转换
- 翻翻git之---一个简单的标签控件 LabelView (随手发了两张小宝宝的玩耍照)
- 前进的道路上,不会是一片坦途