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 三 */