Hi guys,
Can someone show me the DB2 structure for creating multiple CASE statments in the same query? I wrote this query, but I get syntax errors:
SELECT RECIP_SSN_NBR,
CASE WHEN BENEF_STAT_CD = 'AC' THEN 'ACTIVE' ELSE 'INACTIVE' END AS TEST,
CASE WHEN BENEF_STAT_CD = 'DP THEN 'DROP' ELSE 'INACTIVE' END AS TEST2
FROM DSNP.PR01_T_RECIP_SYS
Thanks.
Can someone show me the DB2 structure for creating multiple CASE statments in the same query? I wrote this query, but I get syntax errors:
SELECT RECIP_SSN_NBR,
CASE WHEN BENEF_STAT_CD = 'AC' THEN 'ACTIVE' ELSE 'INACTIVE' END AS TEST,
CASE WHEN BENEF_STAT_CD = 'DP THEN 'DROP' ELSE 'INACTIVE' END AS TEST2
FROM DSNP.PR01_T_RECIP_SYS
Thanks.