首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在hql中使用中间子句

如何在hql中使用中间子句
EN

Stack Overflow用户
提问于 2016-11-02 16:21:48
回答 1查看 28关注 0票数 0

有人能说出请求中有什么问题吗?

代码语言:javascript
运行
复制
 @Query( "SELECT new com.app.gsc.entities.ListeBI(lm.listeDeCriteres.designation,count(*) as totalNumber,lm.ficheDeMission.dateEtHeurDeDepart) from ListeDeControleDetailsMission lm where  lm.boolDepart=false AND Year(lm.ficheDeMission.dateEtHeurDeDepart)=:year AND  Month(lm.ficheDeMission.dateEtHeurDeDepart) >= Month(lm.ficheDeMission.dateEtHeurDeDepart)=:FromMonth AND Month(lm.ficheDeMission.dateEtHeurDeDepart) <= Month(lm.ficheDeMission.dateEtHeurDeDepart)=:ToMonth  GROUP BY lm.listeDeCriteres.designation" )
List<ListeBI> getIncidentDepartByFromToMonth( @Param( "FromMonth" ) int FromMonth, @Param( "ToMonth" ) int ToMonth,
        @Param( "year" ) int year );

错误信息:

代码语言:javascript
运行
复制
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: >= near line 1, column 322 [SELECT new com.app.gsc.entities.ListeBI(lm.listeDeCriteres.designation,count(*) as totalNumber,lm.ficheDeMission.dateEtHeurDeDepart) from com.app.gsc.entities.ListeDeControleDetailsMission lm where  lm.boolDepart=false AND Year(lm.ficheDeMission.dateEtHeurDeDepart)=:year AND  Month(lm.ficheDeMission.dateEtHeurDeDepart) >= Month(lm.ficheDeMission.dateEtHeurDeDepart)=:FromMonth AND Month(lm.ficheDeMission.dateEtHeurDeDepart) <= Month(lm.ficheDeMission.dateEtHeurDeDepart)=:ToMonth  GROUP BY lm.listeDeCriteres.designation]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-02 17:46:52

它必须是这一部分:Month(lm.ficheDeMission.dateEtHeurDeDepart) >= Month(lm.ficheDeMission.dateEtHeurDeDepart)=:FromMonth。我想说的是,你的三个比较有问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40384867

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档