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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

NESTED CASE statement in a SQL

768510Apr 27 2010 — edited May 4 2010
Hi,
I have written a NESTED CASE statement in a SQL but when try running it, I'm getting the error as "missing keyword"
Can someone help me in correcting this?

SELECT ITEM
,DETAIL_LEVEL_DESC AS DESCRIPTION
,COMP_DETAIL_ID AS PROMO_ID
,CASE WHEN CHANGE_TYPE = 'N'
THEN CASE WHEN INSTR(UPPER(DETAIL_LEVEL_DESC), 'S/P')!=0 THEN 'SPP'
WHEN INSTR(UPPER(DETAIL_LEVEL_DESC), 'NIO')!=0 THEN 'NIO'
ELSE 'NEW' END,
ELSE CASE WHEN INSTR(UPPER(DETAIL_LEVEL_DESC), 'SOE')!=0 THEN 'SOE'
ELSE 'SOM' END, SUBTYPE_CODE
FROM PROMO_COMP
ORDER BY ITEM;

regards
Harsha
This post has been answered by Centinul on Apr 27 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2010
Added on Apr 27 2010
9 comments
215,825 views