Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8352895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:06:08+00:00 2026-06-09T09:06:08+00:00

select id,status from request The status column of the above query returns some integer

  • 0
select id,status
from request

The status column of the above query returns some integer values. I need to put a condition to return some strings values instead of the integer values.

eg: if the status 1 then it should return “New” or if the status is 2 then it should return “Approved”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:06:09+00:00Added an answer on June 9, 2026 at 9:06 am

    I despise mysterious integer values stored in a table with no clue as to their meaning.

    My solution will take a bit more work up front, but it is well worth it in the long run.

    Start by creating a new table of StatusValues:

    StatusValues
    ------------
    Status INT PRIMARY KEY
    StatusValue VARCHAR(20)
    

    Populate that table:

    Status    StatusValue
    ------    -----------
    1         New
    2         Approved
    

    Create a foreign key relationship from the Request table to this one:

    ALTER TABLE request
        ADD CONSTRAINT FK_Request_StatusValues FOREIGN KEY (status)
        REFERENCES StatusValues (status);
    

    And finally, write the query:

    SELECT r.id, sv.StatusValue
        FROM request r
            INNER JOIN StatusValues sv
                ON r.status = sv.status;
    

    The previously mysterious request.status column is now well documented and managed within the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like to reverse this query: SELECT * FROM table WHERE status IN (
select tf.Id,tf.Name,tf.LName,tf.Rank,tf.Category where tf.Id not in (select fighter_id from tbl_player_fighter where league_id=91) and tf.Status
SELECT PLD_LINK.ID, PLD_LINK.TITLE, PLD_LINK.URL, PLD_CATEGORY.TITLE, TLL_SORT_STATUS.status, PLD_LINK_COMMENT.DATE_ADDED FROM PLD_LINK, PLD_CATEGORY, TLL_SORT_STATUS, PLD_LINK_COMMENT WHERE PLD_LINK.CATEGORY_ID
dbStatement = con.createStatement(); dbResult = dbStatement.executeQuery(SELECT Vendor_Code FROM temp ORDER BY status ASC );
This is the code I have : $sqlz = SELECT t1.user_id, t2.status, t2.email FROM
Why query: SELECT id, MAX(probe_time) AS Expr1 FROM app_states GROUP BY logon_id and SELECT
I have an question about MYSQL If statement. My request: SELECT c.status, c.thumb, j.id,
i need select data, end i need change column date_payment with DateTime to Text
I have this query: (SELECT e.IdEvent,e.EventName,e.EventSubtitle,e.EventDescription,l.LocationName,e.EventVenue,EventStartDate,e.EventEndDate,e.EventHost,c.CategoryName,l.LocationCity,l.LocationState,e.isTBA, (SELECT s.status FROM jos_rsevents_subscriptions s WHERE s.IdUser =
How do I check status in where clause? SELECT `id`,`name`,`start_date`,`end_date`, CASE WHEN SYSDATE() <

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.