关于sql语句转换为hql

Dovelol 2015-12-10 11:11:27
已知sql语句:select count(s.xm) from (select xm,sum(case when lb = '一级' then je else '0' end) a,sum(case when lb = '二级' then je else '0' end) b from MZJ_DBRYZJYLSBZ group by xm order by xm) s

求问怎么转化为hql语句啊
table MZJ_DBRYZJYLSBZ 对应的实体为 MzjDbryzjylsbz

自己写的hql是:select count(s.xm) from ( select xm,sum(case when lb = '一级' then je else '0' end),sum(case when lb = '二级' then je else '0' end) from MzjDbryzjylsbz group by xm order by xm) as s

但是一直报错 执行不了
有没有大神给解答下 非常感谢了

用的是oracle数据库
...全文
143 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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