对null值排序
select * from t1 order by sname desc;
+-----+-----+--------+
| sid | sno | sname |
+-----+-----+--------+
| 103 | 203 | 徐文宇 |
| 104 | 204 | kk |
| 101 | 201 | NULL |
| 103 | 203 | NULL |
+-----+-----+--------+
select * from t1 order by if(sname is null,0,1),sname desc;
+-----+-----+--------+
| sid | sno | sname |
+-----+-----+--------+
| 101 | 201 | NULL |
| 103 | 203 | NULL |
| 103 | 203 | 徐文宇 |
| 104 | 204 | kk |