0
点赞
收藏
分享

微信扫一扫

对于mysql中字符串的排序

码农K 2022-11-07 阅读 130


一个varchar 的字段 存放 1,2 11等
将字段*1或者+0可以将MySQL字符串字段按数值排序


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

举报

相关推荐

0 条评论