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 can I replace column value with a particular value in SQL

Roshni ShankarOct 27 2012 — edited Oct 27 2012
Hi All,

Can anyone please tell me how can I format my output with replacing a column value with a specific value which actually depends on the present value of the column

I am executing the following SQL statement

select state,count(id) from <table_name> where composite_dn= <composite_dn_name> group by state;
My Present output is:

State No.Of Instance
1 3
3 28

I want to replace the value in the column state as follows

State No.OfInstances
Completed 3
Faulted 28

I want "1" to be reppaced by "Completed" and "3" to be replaced by "Faulted"

Is is possible with SQL or PL/SQL , if it is then how can I achieve this required result. Please help!!

Thanks in Advance!!

Edited by: Roshni Shankar on Oct 27, 2012 12:38 AM
This post has been answered by 915396 on Oct 27 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2012
Added on Oct 27 2012
8 comments
4,621 views