Forum Moderators: open
bu12
bu8
bu9
gu11
gu15
gu8
Then the issue is that numbers at the end of strings are treated as strings, which means bu12 will come before bu8. To fix this problem you can split those fields into two different columns one of which would be numeric - this is really a better database design, but alternatively you can use substrings to "pad" numbers in string with trailing zeros. Say ages can't be greater than 100, so you need to pad all single digit numbers to get the following data:
bu08
bu09
gu11
gu08
bu12
gu15
Then string based sorting will result in the order that you expect. It is better to use 2 columns though.