SQL doubt

Posted on 2009-12-29
Last Modified: 2012-05-08
Hi I have set of data like this..

Status1  Status2
0             1
0             0
1             0
0             1

i need to write a qry to display this records as

Status1       Status2
Incomplete   Complete
Incomplete  Incomplete  
complete     Incomplete  
Incomplete  complete  

Nothing but instead of 0 need to put Incomplete and instead of 1 need to put Complete .. can any one help me to write a oracle sql query .. i can not use pl/sql here ..  i need to use sql alone..
Question by:joe_suganth
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    SELECT CASE Status1 WHEN 0 THEN 'incomplete' else 'Complete' end  as status1 , CASE Status2 WHEN 0 THEN 'incomplete' else 'Complete' end  as status2
    from yourTable
    LVL 142

    Accepted Solution

    so, this is for oracle?

    select decode(status1, 0, 'Incomplete', 1, 'Complete', 'N/A') Status1,
    decode(status2, 0, 'Incomplete', 1, 'Complete', 'N/A') Status2
     from yourtabel

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now