ORDER BY with Numeric Character Strings
Posted on 2010-01-07
I have a table containing a column with numeric character string, examples:
This is a "varchar" column, so when you order it DESC, the result is 999, 998, 1001, 1000
What I really need is to make a selection ordered as if this were an "int" column, so the order would be 1001, 1000, 999, 998.
It is not feasible for me to alter the table because there may be non-numeric values in this column, too.
Is there a way to ORDER BY the natural-number value of the character string?
Thanks and regards to all, ~Ray