create table tb7 (考号 varchar(10) ,姓名 varchar(8)) insert into tb7 select '01010001','' union all select '01100002','' union all select '01020006','' union all select '01300007','' union all select '01050004','' union all select '01000003',''select * from tb7 order by right(考号,4)
order by right(考号,3)
insert into tb7
select '01010001',''
union all select '01100002',''
union all select '01020006',''
union all select '01300007',''
union all select '01050004',''
union all select '01000003',''select * from tb7 order by right(考号,4)
order by left(考号,3)
order by left(考号,3)
2.stuff函数用得少些,建议用根据实际情况使用left、right、substring函数来取得要参加排序的字符。