原有表中的点击次数用的是 字符串型,现要求按点击次数排序,
select * from table t order by t.click desc
查出的是按左对齐排序的
99 97 9 89 783 7
而我要求的是按数字大小排的序
要修改为
select * from table t order by cast (t.click as int) desc
783 99 97 89 9 7
结果正确.