Hi, may be some of you MySQL database guru can shed me some lite to do the
following:
I have rows of data in mysql as follow:
CODES
=====
HH-1
....
HH-1000
When I select the CODE column, instead of getting HH-1,HH-2, HH-3....
it prints HH-1xxx first then HH-2xxx ...
It seems it treats them just as text.
How do I sort it and came out what it should be, HH-1, HH-3, ...HH-21,
,HH-22,...,HH-100, HH-101...etc
Or do I have to make sure that it has 4digit with 0's padding e.g
HH-1-> HH-0001, H-2->HH-0002, HH-156-> HH-0156...
If anyone know that there are an easier way without touching/modifying
what's in the database, I'd appreciate the advice. Thanks