I've got a varchar column that I want to sort numeric, which works great when using this trick: https://stackoverflow.com/a/5418033/1005334 (in short: ...ORDER BY Result * 1
).
However, the table concerned contains results. So something like this occurs:
Result
------
DNS
DNF
1
2
3
The numbers are correctly ordered, but the DNF
comes above the numbers when sorting like this. What I'd like is to have the numeric sort, but with non-numbers sorted alphabetically below the numbers. Like so:
Result
------
1
2
3
DNF
DNS
In what way can I modify the query (preferably only the ORDER BY
clause) to get this result?