SELECT test_column FROM test_table ORDER BY test_column
gives me this:
1
12
123
2
3
Why not:
1
2
Try
SELECT test_column
FROM test_table
ORDER BY cast(test_column as int)
But you should look into changing the column types to the correct ones.
This work me:-
ORDER BY cast(test_column as SIGNED)
Check if the type of the column is varchar or something similar. Looks like it is being ordered by string value, not by numeric value. If the column only contains numbers it should better be of type int.
The sort is working. It's a lexicographic sort (alphabetical). It appears that that column has a text (char, varchar, ...) type, so the ordering you'll get is textual and not numeric.
If you want a numerical sort, use a numeric column type (e.g. int). (Or cast the column appropriately.)