关于sql语句转换为hql
已知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数据库