我有一个 sql 查询
select count(salary)
from USER_DETAILS
where salary>0 and salary<1000 union all
select count(salary)
from USER_DETAILS
where salary>1000 and salary<10000 union all
select count(salary)
from USER_DETAILS
where salary>10000 and salary<100000
是否有任何其他合乎逻辑或更稳健的方式来执行相同的查询(最好在 hql 中)。
提前致谢