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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:10:43+00:00 2026-06-09T11:10:43+00:00

I have a varchar field in my table with various entries. How can I

  • 0

I have a varchar field in my table with various entries. How can I use the order by statement to get the following result:

1
2
3
4
5
6
7
8
9
10
Steinstrass 1
Steinstrass 2
Steinstrass 3
Steinstrass 4
Steinstrass 5
Steinstrass 6
Steinstrass 7
Steinstrass 8
Steinstrass 9
Steinstrass 10
  • 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-09T11:10:45+00:00Added an answer on June 9, 2026 at 11:10 am

    This worked for me:

    mysql> select * from sorting;
    +---------+
    | field1  |
    +---------+
    | 1       |
    | 4       |
    | 10      |
    | Item 1  |
    | Item 10 |
    | Item 0  |
    | 0       |
    +---------+
    7 rows in set (0.00 sec)
    
    mysql> select field1 from sorting order by length(field1),field1 asc;
    +---------+
    | field1  |
    +---------+
    | 0       |
    | 1       |
    | 4       |
    | 10      |
    | Item 0  |
    | Item 1  |
    | Item 10 |
    +---------+
    7 rows in set (0.00 sec)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have a varchar field you can easily do SELECT * FROM TABLE
I have a table named buildings that contains a varchar(50) field named use. The
I have a varchar email field in my table. I can't figure out the
I have an SQL Server 2005 table that has a varchar(250) field which contains
Ok I'm using SQL Server 2008 and have a table field of type VARCHAR(MAX)
I have a varchar field in my database which i use for two significantly
I have a varchar field that contains a string like 10,11,12,13. How can I
Let's say I have a table that has a varchar field. If I do
How does MySQL store a varchar field? Can I assume that the following pattern
If I have a column in table with field of type VARCHAR(15) and if

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.