declare @test table(aid int,[name] varchar(10)) insert into @test select 1,'aa' insert into @test select 2,'a2a' insert into @test select 3,'a242a' insert into @test select 4,'a2a' insert into @test select 5,'a23a' insert into @test select 6,'a42a' insert into @test select 7,'aa' insert into @test select 8,'a434a' insert into @test select 9,'ara' insert into @test select 10,'a4a' insert into @test select 11,'area' insert into @test select 12,'aa' insert into @test select 13,'area' insert into @test select 14,'rer' insert into @test select 15,'t4r'select * from (select top 10 * from @test order by aid desc)a order by aid
select * from (select top 10 * from test order by aid desc) a order by 内容字段
declare @test table(aid int,[name] varchar(10)) insert into @test select 1,'aa' insert into @test select 2,'a2a' insert into @test select 3,'a242a' insert into @test select 4,'a2a' insert into @test select 5,'a23a' insert into @test select 6,'a42a' insert into @test select 7,'aa' insert into @test select 8,'a434a' insert into @test select 9,'ara' insert into @test select 10,'a4a' insert into @test select 11,'area' insert into @test select 12,'aa' insert into @test select 13,'area' insert into @test select 14,'rer' insert into @test select 15,'t4r'select * from (select top 10 * from @test order by aid desc)a order by [name] --没看清。呵呵
select * from (select top 10 * from test order by aid desc) a order by aid
select * from test where aid in(select top 10 aid from test order by aid desc) order by aid asc
select * from ( select top 10 * from test order by aiddesc )a order by aid
insert into @test select 1,'aa'
insert into @test select 2,'a2a'
insert into @test select 3,'a242a'
insert into @test select 4,'a2a'
insert into @test select 5,'a23a'
insert into @test select 6,'a42a'
insert into @test select 7,'aa'
insert into @test select 8,'a434a'
insert into @test select 9,'ara'
insert into @test select 10,'a4a'
insert into @test select 11,'area'
insert into @test select 12,'aa'
insert into @test select 13,'area'
insert into @test select 14,'rer'
insert into @test select 15,'t4r'select * from (select top 10 * from @test order by aid desc)a order by aid
insert into @test select 1,'aa'
insert into @test select 2,'a2a'
insert into @test select 3,'a242a'
insert into @test select 4,'a2a'
insert into @test select 5,'a23a'
insert into @test select 6,'a42a'
insert into @test select 7,'aa'
insert into @test select 8,'a434a'
insert into @test select 9,'ara'
insert into @test select 10,'a4a'
insert into @test select 11,'area'
insert into @test select 12,'aa'
insert into @test select 13,'area'
insert into @test select 14,'rer'
insert into @test select 15,'t4r'select * from (select top 10 * from @test order by aid desc)a order by [name]
--没看清。呵呵
select top 10 * from
test order by aiddesc )a
order by aid