只能限定排序规则.如: 例1:让表NAME列的内容按拼音排序:create table #t(id int,name varchar(20)) insert #t select 1,'中' union all select 2,'国' union all select 3,'人' union all select 4,'阿'select * from #t order by name collate Chinese_PRC_CS_AS_KS_WS drop table #t /*结果: id name ----------- -------------------- 4 阿 2 国 3 人 1 中 */ 例2:让表NAME列的内容按姓氏笔划排序:create table #t(id int,name varchar(20))insert #t select 1,'三' union all select 2,'乙' union all select 3,'二' union all select 4,'一' union all select 5,'十' select * from #t order by name collate Chinese_PRC_Stroke_CS_AS_KS_WS drop table #t /*结果: id name ----------- -------------------- 4 一 2 乙 3 二 5 十 1 三 */
nchar(),nvarchar(),ntext()unicode
例1:让表NAME列的内容按拼音排序:create table #t(id int,name varchar(20))
insert #t select 1,'中'
union all select 2,'国'
union all select 3,'人'
union all select 4,'阿'select * from #t order by name collate Chinese_PRC_CS_AS_KS_WS
drop table #t
/*结果:
id name
----------- --------------------
4 阿
2 国
3 人
1 中
*/ 例2:让表NAME列的内容按姓氏笔划排序:create table #t(id int,name varchar(20))insert #t select 1,'三'
union all select 2,'乙'
union all select 3,'二'
union all select 4,'一'
union all select 5,'十'
select * from #t order by name collate Chinese_PRC_Stroke_CS_AS_KS_WS
drop table #t
/*结果:
id name
----------- --------------------
4 一
2 乙
3 二
5 十
1 三
*/