MySQL - 按字母顺序排列所有数据,但将特定项目放在最后
这个问题已经被问到了 MySql,不幸的是这个解决方案不适用于 SQL Server。这是我当前的查询和结果:
select ShipMethodID As UseMe, Name As ShowMe
from Purchasing.ShipMethod
union
Select 0 As UseMe, 'n/a' As ShowMe
order by ShowMe
结果:
5 CARGO TRANSPORT 5
0 n/a
4 OVERNIGHT J-FAST
3 OVERSEAS - DELUXE
1 XRQ - TRUCK GROUND
2 ZY - EXPRESS
我需要像这样进行排序:
0 n/a
5 CARGO TRANSPORT 5
4 OVERNIGHT J-FAST
3 OVERSEAS - DELUXE
1 XRQ - TRUCK GROUND
2 ZY - EXPRESS