有ID字段时select top 1 * from table where id not in(select top 9999 id from table order by col)
order by col

解决方案 »

  1.   

    没有ID时先:select identity(int,1,1) as id,* into #temp from table order by col
    select * from #temp where id=10000
      

  2.   

    select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表
    select * from #temp where ID_Num>10 and ID_Num<=20
      

  3.   

    exec('SELECT Top '+cast(@PageSize as varchar)+' * FROM T WHERE SortField NOT IN (SELECT TOP '+cast(@PageSize* @Pagei as varchar)+' SortField from T )')
      

  4.   

    起思想就是取 9999〈x〈=10000的id
      

  5.   

    CrazyFor(蚂蚁)有ID时通过(SQL SERVER7),无ID时按某字段排序不对.
    pengdali(大力) 第一条(无ID)结果与CrazyFor(蚂蚁)无ID时结果一样.