num 为varchar 类型,按num 进行排序
select * from contest_info order by num asc
得到结果是按字典序排序,并不是预期中以数字大小排序。
若想让数字格式的字符串按数字大小排序,则SQL修改为:
select * from contest_info order by num+0 asc
此时结果为:
与预期结果一致