I'm using Oracle version 10.2 and have a query which contains many WHERE conditions, but one in particular I cannot get to work. Here is the code:
If I comment out the last line, and move the END CASE statement to follow the 'CC" line, it works just fine. I have tried MANY different ways to concatonate the values together, but none of them work. Any helpful suggestions would be greatly appreciated.
Code:
where table.division_id in (CASE WHEN :Division = 'AA' THEN '02'
WHEN :Division = 'BB' THEN '09'
WHEN :Division = 'CC' THEN '07'
WHEN :Division = 'ALL' THEN '02'||','||'07'||','||'09'
END CASE)