select case when emp_sal > 1000 then 500 end from emp
You can also use multiple case conditions and also ELSE case.
Sample:
select
case
when emp_sal > 1000 then 5000
when emp_sal > 2000 then 4000
else 0
end
from emp
You can also use nested case statements.
Sample:
select
case
when emp_sal > 1000 then case when xxx = 3 then x else y end
when emp_sal > 2000 then 4000
else 0
end
from emp
For more samples and any other SQL questions I recommend DB2 Cookbook - the best free SQL book ever seen:
http://mysite.verizon.net/Graeme_Birchall/id1.html
Hope this helps,
Grofaty