So I have a bunch of varchars that I need to sort in a certain way, first be alpha, and then treat the following number as a whole number (i.e. A2 would be before A10). That's the main problem, and then I have some with 'sub' letters after like A1M. Don't want to have to add a new column just for sorting, so I wanted to see if a more complex ORDER BY statement might be able to handle something like this.
They should be sorted like this:
A1
A1M
A2
A6
A6B
A9
A10
A15
A16
AS10
But it currently sorts like this (standard ORDER BY):
A1
A10
A15
A16
A1M
A2
A6
A6B
A9
AS10