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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:39:30+00:00 2026-06-06T18:39:30+00:00

I have fields in the column that look like so: 2/8B, 3, 3/8B, 4/8B,

  • 0

I have fields in the column that look like so:

2/8B, 3, 3/8B, 4/8B, 2, 6, 4/9, 9, 8/9, 8, 7, 1, 5/9, 10, 3/9, 2/9, 7/9, 6/8B, 6/9, 1/9, 5, 8B, 5/8B, 4

I need to sort this list in a manner like:

1, 1/9, 2, 2/8B, 2/9, 3, 3/8B, 3/9, 4, 4/8B, 4/9, 5, 5/8B, 5/9, 6, 6/8B, 6/9, 7, 7/9, 8, 8/9, 8B, 9, 10

How do I Order By to create this output?

To clear up any confusion (1/2) is not a fraction. the “/” is just a separator.

  • 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-06T18:39:31+00:00Added an answer on June 6, 2026 at 6:39 pm

    I don’t get it; using the characters you’ve provided DOES sort in the order you requested. Give it a shot:

    SELECT Test
    FROM (
        SELECT '38a' AS Test
        UNION
        SELECT '1'
        UNION 
        SELECT '1/2'
        UNION
        SELECT '12'
    ) MyData
    ORDER BY Test ASC
    

    EDIT

    Now that you’ve given concrete examples, I see it was the 10 and 8B that were throwing things off. Try this instead:

    SELECT YourCol
    FROM YourTable
    ORDER BY CAST(REPLACE(REPLACE(REPLACE(YourCol, 'B', '.99'), '/', '.'), 
        '.8.99', '.899') AS NUMERIC(18, 4))
    

    This will order it as:

    1, 1/9, 2, 2/8B, 2/9, 3, 3/8B, 3/9, 4, 4/8B, 4/9, 5, 5/8B, 5/9, 6, 6/8B, 6/9, 7, 7/9, 8, 8/9, 8B, 9, 10

    It’s ugly, but it works. If you have other letters besides B, the script will have to be changed to handle that.

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

Sidebar

Related Questions

I have a database that has two tables, these tables look like this codes
I have a list of fields/columns that comprises of Sharepoint specific fields/columns, my own
I have a general query that looks like this: SELECT DISTINCT pb.id, pb.last, pb.first,
I have a user table that has many columns, it looks roughly like this:
I have a table like this. The second column uses a JTextField renderer and
I am working on a profit and loss report that should look like this:
Python beginner here. I have a text file that is sorted into columns: fields
I have a form with the fields inside table cells. On the last column
I have some documents in couchdb that have fields that are arrays of id's
I need to create an input form that will allow a user to enter

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.