select name , case when sal >= 1000 and sal < 2000 then 1 else 2 end as level, sal
from emp
where deptno = 30
order by 2,3
select name , case when sal >= 1000 and sal < 2000 then 1 else 2 end as level, sal
from emp
where deptno = 30
order by 2,3