If you are on ORACLE 8, there is CASE function available. Otherwise you will have to use DECODE and SIGN functions.