hibernate是不是不支持子查询

jjtking 2008-12-18 10:46:30
select prop_department, prop_team,name, max(case ifnull(state,-1) when -1 then count else 0 end) as 'null', max(case state when 1 then count else 0 end) as '1', max(case state when 2 then count else 0 end) as '2', max(case state when 3 then count else 0 end) as '3' from (select i.prop_department , i.prop_team , u.name,i.cus_int_03 as state,count(*) as count from Items i , users u where u.id=i.logged_by group by i.prop_department,i.prop_team,u.name,i.cus_int_03) table1 group by prop_department,prop_team,name


用这个语句查询的时候一直报错,如果table1是一张实际的表就一点问题都没有。各位大侠指点下迷津,看看应该怎么改才能让hibernate支持这个语句。
...全文
174 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧