SELECT product_id, product_type_id,
CASE product_type_id
WHEN 1 THEN 'Book'
WHEN 2 THEN 'Video'
WHEN 3 THEN 'DVD'
WHEN 4 THEN 'CD'
ELSE 'Magazine'
END
FROM products;
SELECT
CASE COLUMN1 WHEN 'N' THEN
CASE COLUMN2
WHEN 1 THEN NVL(COLUMN3,COLUMN4)
WHEN 2 THEN NVL(COLUMN3,COLUMN4)
WHEN 3 THEN NVL(COLUMN3,COLUMN4)
WHEN 4 THEN NVL(COLUMN3,COLUMN4)
WHEN 5 THEN NVL(COLUMN3,COLUMN4)
WHEN 6 THEN NVL(COLUMN3,COLUMN4)
ELSE COLUMN5 END
ELSE COLUMN6 END
FROM TABLE_NAME