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

  • Home
  • SEARCH
  • 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 7531311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:08:15+00:00 2026-05-30T05:08:15+00:00

i have field with content like this: 1, 2, 100 first two numbers can

  • 0

i have field with content like this: 1, 2, 100 first two numbers can be any size third one can be up to 100.

Now i need to sort my fields by this third number but since i have 2 other numbers i don’t know how to do it.

Maybe i could use something like REGEXP or something else?
So far i’ve tried SUBSTRING but since my two numbers can be any lenght something like

order by SUBSTRING(my_field, 4)

would work but if i have numbers like 32, 451, 30 it takes wrong numbers

Also i use php for to build my query, but i don’t think it matters.

  • 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-30T05:08:16+00:00Added an answer on May 30, 2026 at 5:08 am

    You can use SUBSTRING_INDEX. So something like:

    SUBSTRING_INDEX(my_field, ',', -1)
    

    EDIT: if you have spaces you might want to do some trimming as well.

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

Sidebar

Related Questions

Does anyone have any good links for developing custom field and content types that
I have field like a_b_c_d I want as the output a b c_d, this
I have some html content stored in a database field. I would like trusted
I have a table called wp-posts with a field post-content. This field contains the
I'm pulling a content from PHP array and I have a situation like this:
I have a large text field taken from a database rs.Item(content) How can I
I have some flatpages with empty content field and their content inside the template
I have one field that I need to sum lets say named items However
I have a field with the following content in a record in my SQL
I have tried and tried and tried now. I have a mysql field (TEXT)

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.