Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Use a 'Case' statement in the negative

user12296489Nov 10 2010 — edited Nov 10 2010
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
This post has been answered by Frank Kulash on Nov 10 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2010
Added on Nov 10 2010
7 comments
1,755 views