order by case 字段 when '一' then 1 '二' then 2 '三' then 3 '四' then 4 '五' then 5 end
order by case 字段 when '一' then 1 '二' then 2 '三' then 3 '四' then 4 '五' then 5 end
order by charindex(字段,'一 二 三 四 五')
create table aaaa (a char(1)) goinsert into aaaa values('四') insert into aaaa values('五') insert into aaaa values('三') insert into aaaa values('一') insert into aaaa values('二') goselect * from aaaa order by charindex(a,'一二三四五')
'一' then 1
'二' then 2
'三' then 3
'四' then 4
'五' then 5
end
'一' then 1
'二' then 2
'三' then 3
'四' then 4
'五' then 5
end
goinsert into aaaa values('四')
insert into aaaa values('五')
insert into aaaa values('三')
insert into aaaa values('一')
insert into aaaa values('二')
goselect * from aaaa order by charindex(a,'一二三四五')
order by charindex(a,'一二三四五')