怎么做多列的排序如表
列一 列二 列三
a b 1
c e 2
a b 3
a f 4
c e 5------------------------
我要得到的表为
列一 列二 列三
a b 1
a b 3
c e 2
c e 5
a f 4我要怎么写sql语句
列一 列二 列三
a b 1
c e 2
a b 3
a f 4
c e 5------------------------
我要得到的表为
列一 列二 列三
a b 1
a b 3
c e 2
c e 5
a f 4我要怎么写sql语句
(
id int,
a char(2),
b char(2))
insert into #t select 1,'a','b'
union all select 2,'c','e'
union all select 3,'a','b'
union all select 4,'a','f'
union all select 5,'c','e'
select * from #t
order by b,a,id