数据库中存在0,1,2.....或者1,null,2 排序时让0或者null在最后的sql语句

Posted 爷的眼睛闪亮

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数据库中存在0,1,2.....或者1,null,2 排序时让0或者null在最后的sql语句相关的知识,希望对你有一定的参考价值。

 select * from yryz_products_t order by isnull(sort),sort; 
 
 select * from yourtable order by cast(sort as int);   此sql为转换

以上是关于数据库中存在0,1,2.....或者1,null,2 排序时让0或者null在最后的sql语句的主要内容,如果未能解决你的问题,请参考以下文章