How to Use a 'Case' statement in the negative
I am pulling data in the form:
SELECT
group_num,
co_id,
pr_id,
CASE co_id
WHEN '5N' THEN 'YES'
WHEN NOT '5N' THEN 'NO'
END AS prod_type
from table1
I want to get a result of 'YES' when co_id is '5N' and all co_id's that are not '5N' a value of 'NO'..
I'm getting an error 'Missing Expression' and its pointing at the line 'WHEN NOT', so I obviously haven't got the syntax correct..
Any help would be appreciated..
Edited by: user12296489 on Nov 10, 2010 11:22 AM