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 6375159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:34:46+00:00 2026-05-25T01:34:46+00:00

I have 3 columns in my table status enum(‘Completed’,’Incomplete’,’In Progress’) severity enum(‘High’,’Low’,’Moderate’) created datetime

  • 0

I have 3 columns in my table

  1. status enum(‘Completed’,’Incomplete’,’In Progress’)
  2. severity enum(‘High’,’Low’,’Moderate’)
  3. created datetime

Now currently i am ordering by severity ASC created DESC status DESC. which is not working right. This is how i want it to be listed.

  1. Incomplete – High
  2. Incomplete – moderate
  3. Incomplete – low
  4. In Progress – High
  5. In Progress – moderate
  6. In Progress – low
  7. Completed – High
  8. Completed – moderate
  9. Completed – low
  • 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-05-25T01:34:47+00:00Added an answer on May 25, 2026 at 1:34 am

    As well as Andomar’s solution, I’d consider having proper tables for status and severity. Not enums.

    You can imply sort order from the key of these tables, but I’d probably have a “SortOrder” column for future use.Then you can JOIN the tables and order by the SortOrder.

    No need repeat the CASE in every query that needs it

    Edit: Simplifying Andomar’s idea…

    order by
        case status
           when 'Incomplete' then 1
           when 'In Progress' then 2
           when 'Completed' then 3
        END,
        case severity
           when 'High' then 1
           when 'Moderate' then 2
           when 'Low' then 3
        END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with three columns: user varchar, status varchar , rep int
I have two columns in my table and the rows are created dynamically. <table
I have a table with columns record_id (auto inc), sender , sent_time and status
I have a table which has columns of data that contain status. Two example
Suppose I have a table with 2 columns (status and date) like the following:
I have a table MyTable with columns: ID number (autoincrement) STAT number(3) (status: 1-start,
I have a Product table with non-null quantity (decimal) and status (int) columns, and
I have a MySQL InnoDB table with a status column. The status can be
I have a table called ApprovalTasks... Approvals has a status column I also have
The table columns have the data type BLOB and CLOB. What are the corresponding

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.