如何让数据库排序的时候按照中文的拼音来排序?

要排序的字段是中文的。
如何按照拼音的次序来排序?
而不要按照中文的ascii码来排序。
---------------------------------------------------------------
摘自我的新帖子:
http://expert.csdn.net/Expert/topic/1219/1219255.xml

select * from test
order by name collate Chinese_PRC_CS_AS_KS_WS

name
-----------
a上海
b上海
c上海
包钢
河北
上海
朱穆拉马

or:
alter table test alter column name nvarchar(100) COLLATE Chinese_PRC_CS_AS_KS_WS

select * from test order by name

name
-----------
a上海
b上海
c上海
包钢
河北
上海
朱穆拉马

Published At
Categories with 数据库类
comments powered by Disqus