Jump to content

get results in alphanumric order, but letters first then numbers and other char-


jasonc

Recommended Posts

Note: this is untested..

 

SELECT * FROM table_name ORDER BY LEFT(col_name,1) > 0, left(col_name,1), substring(col_name,2) > 0

 

I just tried this query and seems to work, only thing is that it shows like so

 

0 (zero)

a

b

c

d

...

1

2

3

4

looking at mysql these are the entries...

 

0.5L Cliptop Jar

0.5L Kilner Preserve Jar

Animal Ice Packs 3 Character Cells

Ant Killer Gel

Accents Brushed Stainless Steel 2 Slice Toaster

 

This is how they show, this is only a snippet of my data of course, but just to show where it is going wrong.

 

 

 

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.