If salary of employee is below 50,000 then rank = 1, up to 100 000 then rank 2, up to 150 000 then rank 3.Can I get this using rank function?
SELECT CASE WHEN SALARY BETWEEN 1 , 50000 then 1
else case when salary between 50000 , 100000 then 2
else case when salary between 150000 , 200000 then 3 else 4 end as rank FROM EMPLOYEE WHERE EMP = 1