When you order by a character field, letters are sorted before numbers.
E.g.
'AZA'
'A9A'
'AAA'
'A0A'
Sorts ascending to:
'AAA'
'AZA'
'A0A'
'A9A'
Is there any way to make SQL sort numbers before letters? So I would get this instead:
'A0A'
'A9A'
'AAA'
'AZA'
Note that I care about numerics anywhere in the field (which is a varchar 32)
E.g.
'AZA'
'A9A'
'AAA'
'A0A'
Sorts ascending to:
'AAA'
'AZA'
'A0A'
'A9A'
Is there any way to make SQL sort numbers before letters? So I would get this instead:
'A0A'
'A9A'
'AAA'
'AZA'
Note that I care about numerics anywhere in the field (which is a varchar 32)
Comment