没有:
http://expert.csdn.net/Expert/topic/2365/2365596.xml?temp=.5068781
交流--查询第X页,每页Y条记录
邹建

解决方案 »

  1.   

    CREATE PROCEDURE GetProductsPaged
    @lastProductID int,
    @pageSize int
    AS
    SET ROWCOUNT @pageSize
    SELECT *
    FROM Products
    WHERE [standard search criteria]
    AND ProductID > @lastProductID
    ORDER BY [Criteria that leaves ProductID monotonically increasing]
    GO
      

  2.   

    eg:
    200-400
    select top 200 * from (select top 400 * from tablename order by id) order by id desc
      

  3.   

    查询N-M条记录。
    select IDENTITY(int,1,1) as iid,* into #temptable from yourtable
    select top M-N * from #temptable where iid>=NOR:select top M-N * from yourTable where id not in(select top N-1 id from table)
    ID为表具有唯一值的任何字段
      

  4.   

    查询N-M条记录。 select IDENTITY(int,1,1) as iid,* into #temptable from yourtable select top M-N * from #temptable where iid>=N OR: select top M-N * from yourTable where id not in(select top N-1 id from table) ID为表具有唯一值的任何字段