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