Grouping on Column Expressions

来源:互联网 发布:商品关键字的seo处理 编辑:程序博客网 时间:2024/05/21 17:07
select case mod(empno,2)
when 0 then 'EVEN '
else 'ODD '
end as empno
sum(msal)
from employees
group by mod(empno,2);
EMPNO SUM(MSAL)
----- ---------
EVEN 20225
ODD 8650