Jump to content

Natural sort, letters first


silkfire

Recommended Posts

I know that if you want to make a natural sort with numbers first you just do 'ORDER BY field + 0' but what is it's the other was around and the letter prefix is of variable width?

 

Right now if I do a normal order it comes out like this:

 

EK1023

T15

T18

T2

T24

T4

T7

 

I want it like this:

 

EK1023

T2

T4

T7

T15

T18

 

What's the magic query?

Link to comment
https://forums.phpfreaks.com/topic/235098-natural-sort-letters-first/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.