我有以下SQL语句:
SELECT fldTitle
FROM tblTrafficAlerts
ORDER BY fldTitle
以下是返回结果(来自
NVARCHAR
列)的顺序:A1M northbound within J17 Congestion
M1 J19 southbound exit Congestion
M1 southbound between J2 and J1 Congestion
M23 northbound between J8 and J7 Congestion
M25 anti-clockwise between J13 and J12 Congestion
M25 clockwise between J8 and J9 Broken down vehicle
M3 eastbound at the Fleet services between J5 and J4A Congestion
M4 J19 westbound exit Congestion
您会发现M23和M25列在M3和M4的上面,这看起来不太顺眼,如果要扫描更长的结果列表,您不希望按照这个顺序阅读它们。
因此,我希望结果能按字母顺序排序,然后按数字顺序排列,看起来像这样:
A1M northbound within J17 Congestion
M1 J19 southbound exit Congestion
M1 southbound between J2 and J1 Congestion
M3 eastbound at the Fleet services between J5 and J4A Congestion
M4 J19 westbound exit Congestion
M23 northbound between J8 and J7 Congestion
M25 anti-clockwise between J13 and J12 Congestion
M25 clockwise between J8 and J9 Broken down vehicle
所以M3和M4出现在M23和M25之上。