比如将 300 条记录分两次或者三次显示,如何实现呀?比如前一百记录是:select top 100 * from table...而后面的记录如何显示呀?比如第二段是从 201-300 的怎么写呢?

解决方案 »

  1.   

    select top * 100 from (select top 200 * from Table1 order by ID) T order by  id DESC
      

  2.   

    select top 100 *  from (select top 200 * from Table1 order by ID) T order by  id DESC
      

  3.   

    这个问题还有在:http://community.csdn.net/Expert/topic/4615/4615115.xml?temp=.2055323 的讨论如下:
    因为我现在得出的记录是从三张表中联合查询出来的,当再次使用 select 嵌套的话总会有以下信息出现:多次为 ‘table’指定了列 ‘列名’。我的具体代码如下:select * from
    (
    select top 100 * from a,b,c
    where (a.id=b.id and b.id=c.id and b.col1='100' and c.col2='10')
    order by convert(int,a.id)desc
    )a order by a.id