I have the following expression from DB2 which supports the ansi case expression:
I'm trying to rewrite this for oracle 8. I believe later versions of oracle support the case expression, but oracle 8 does not. Does anyone know how I can accomplish the same thing using the decode() function?
Code:
CASE
WHEN ri.mamapc='QS' THEN 'Q'
WHEN ri.mamapc LIKE 'Z%' THEN 'F'
WHEN UPPER(ri.mamati) LIKE '%2ND XS%' THEN '2'
WHEN UPPER(ri.mamati) LIKE '%SECOND EXCESS%' THEN '2'
WHEN UPPER(ri.mamati) LIKE '%SURPLUS%' THEN 'S'
ELSE 'X' END
AS Category,