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!

Alias in CASE statement

user10412263Apr 7 2014 — edited Apr 7 2014

Please let me know how we can we use alias name in WHEN clause of CASE statement.

e.g.

SELECT id, name,

case when mon = 'JAN' THEN amt "Jan Sal"

        when mon = 'FEB' THEN amt "Feb Sal"

END

FROM table;

    

This query throws an error : missing keyword.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2014
Added on Apr 7 2014
12 comments
10,199 views