select sal, case when sal < 2000 then 'category 1'
when sal < 3000 then 'category 2'
when sal < 4000 then 'category 3'
else 'category 4'
end
from emp;In the query above how to say Category 1 = 0 when there are no employees with salary less than 2000
↧
If particular condition is not satisfied in case how to say that to be zero
↧