select top 10 *
from 表名
order by 字段名 desc

解决方案 »

  1.   

    select top 10 * from 表 order by id desc
      

  2.   

    select identity(int,1,1) id,* into #a from table1 
    select top 10 表中其他字段 from #a order by id 
      

  3.   

    不好意思 ,发错了~~可以借用临时表来处理select identity(int,1,1) id,* into #a from table1 
    select top 10 表中其他字段 from #a order by id desc
      

  4.   

    select top 10 *
    from table
    order by 字段名 desc
      

  5.   

    分情况讨论
    1.有主键,可以断号,按照升序排列,降序排列请举一反三!
      select top 10 * from Table order by id desc2.有key值,但是不是主键,而且无序!(这种方法也适用第一种情况)
      declare @len as int --纪录资料共有多少笔,然后查询出除了后面10笔的其他资料
      declare @str as Nvarchar(4000)
      select * from Table
      set @len = @@rowcount   
      set @str =N'select * from Table where  id not in (select top ' + convert(varchar(10),@len - 10 ) + ' id from Table)'
      exec sp_executesql  @str 
    3,没有key值,杂乱无序,那么只有死马当活马医,用identity()加个序号,!(这种方法也适用前面2种情况)
    select identity(int,1,1) as sn ,Table.* into #tempTable from Table
    select top 10 Col1,Col2,... from #tempTable order by sn desc
      

  6.   

    select top 10 * from Table order by id desc  根据你条件来 id desc  来倒取数据10条
      

  7.   

    select identity(int,1,1) id2,* into #T from table1 
    select top 10 除了上面的id2字段 from #T order by id2 desc
      

  8.   

    select identity(int,1,1) as ID ,Table.* into T#2   from T#1    //添加标志位  生成新的表select top 10    Col1,Col2,... from T#order by  ID desc
      

  9.   

    select identity(int,1,1) as sn ,Table.* into #tempTable from Table
    select top 10 Col1,Col2,... from #tempTable order by sn desc
      

  10.   

    select top 10 * from 表名 order by id desc
    好象都差不多都是这个