如果可能,则无论如何仅存储数字,应将列的数据类型更改为数字。
如果您无法执行此操作,则将列值
integer强制转换 为
select col from yourtableorder by cast(col as unsigned)
或 隐式地 使用例如数学运算来强制转换为数字
select col from yourtableorder by col + 0
BTW MySQL将字符串从左到右转换。例子:
string value | integer value after conversion--------------+--------------------------------'1'| 1'ABC' | 0 '123miles' | 123 '$123' | 0



