ORDER BY … COLLATE in SQL Server

对着背影说爱祢 提交于 2019-11-29 10:17:48

Because that is the correct case sensitive collation sort order. It is explained in Case Sensitive Collation Sort Order why this is the case, it has to do with the Unicode specifications for sorting. aa will sort ahead of AA but AA will sort ahead of ab.

You need a binary collation for your desired sort order with A-Z sorted before a-z.

SELECT * FROM T1 ORDER BY C1 COLLATE Latin1_General_bin

The CS collation sorts aAbB ... zZ

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!