为什么select top 5 * from CD_info where ID not in(select top 0 ID from CD_info);有错?

解决方案 »

  1.   

    If you're using sqlserver 2005, try this: http://www.singingeels.com/Articles/Pagination_In_SQL_Server_2005.aspx
    SELECT TOP 5 * FROM (SELECT
       ROW_NUMBER() OVER (ORDER BY ID) AS RowNumber,
       *
    FROM
       CD_info) _myResults
    WHERE
       RowNumber > 5If sql server 2000,  try this: http://weblogs.sqlteam.com/jeffs/archive/2004/03/22/sql-server-2000-paging.aspx
      

  2.   

    为什么是TOP 0 ,而不是TOP 1 
      

  3.   

    没错啊!在sql server 2005 完全可以!