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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:23:16+00:00 2026-06-02T08:23:16+00:00

Trying to sort the following TEAM_TOTAL Column Desc MATCHID TEAM_TOTAL ———- —————– 573 Total

  • 0

Trying to sort the following TEAM_TOTAL Column Desc

MATCHID     TEAM_TOTAL        
 ----------  ----------------- 
 573         Total   112       
 573         Total  2 for  115 
 574         Total  9 for  97  
 574         Total  2 for  100 
 575         Total  9 for  129 
 575         Total  9 for  101 
 576         Total  4 for  191 
 576         Total  9 for  160 
 577         Total  8 for  157 
 577         Total  7 for  137 
 578         Total  6 for  193 
 578         Total   119 

But the problem is TEAM_TOTAL is varchar, is there a way with query alone I can get the results in the sorted desc order.
More over there is a text as well in that column. I am running out of ideas to get this up

Result should have beeen like the below Result Set

   MATCHID     TEAM_TOTAL        
  ----------  ----------------- 
  578         Total  6 for  193
  576         Total  4 for  191  
  576         Total  9 for  160 
  577         Total  8 for  157 
  577         Total  7 for  137
  575         Total  9 for  129
  578         Total   119 
  573         Total  2 for  115 
   573         Total   112 
  575         Total  9 for  101
  574         Total  2 for  100
  574         Total  9 for  97
  • 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-02T08:23:17+00:00Added an answer on June 2, 2026 at 8:23 am

    Give this a try:

    select * from t
    order by substring(
        team_total, locate('for', team_total) + 
            if(locate('for', team_total) > 0, 4, 7))+0 desc
    

    Fiddle here.

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

Sidebar

Related Questions

I've written the following IComparer but I need some help. I'm trying to sort
I am trying to sort a two-dimensional array by a timestamp column Descending. This
Let's say I'm trying to sort the following array. String[] array = { ABC12,
my array jokesarray has elements like the following. I am trying to sort by
I'm trying to do the following sort of thing in Javascript, where you click
I am trying to sort a gridview in visual basic using the following method,
I've been trying to work out whether it's possible to do the following sort
I am trying to sort a worksheet by the first column in excel using
I was trying to sort a vector of struct.The following is my code.I am
I'm trying to sort out a problem where I need to write the following

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.