MySQL 数字字符串按照数字排序

一个关于MySQL字符串排序,在数据里面定义的是varchar类型,实际存放的是Int类型的数据,按一下查询语句进行排序: 
将字段*1或者+0可以将MySQL字符串字段按数值排序 


如: 

1 select * from table where 1 order by id*1 desc; 


或者 

1 select * from table where 1 order by id+0 desc;

除了上述方法外,这里附上一种排序方法,利用find_in_set()进行无敌排序
MySQL常用函数列表

参考链接:https://blog.csdn.net/weixin_40607363/article/details/81776951

原文地址:https://www.cnblogs.com/guliang/p/11736173.html