select * from table_name where id_field not in (select top 3 id_field from table_name)

解决方案 »

  1.   

    从第三条记录开始取select * from 表 where 编号 not in (select top 2 编号 from 表)
      

  2.   

    几位,我写了不行啊,我是这样写的:select * from billhistory
     where 
    billId='SZ200302090001' 
    and billid not in (select top 2 billid from billhistory)
    结果有几行还是取出来几行了,怎么回事?请继续指教!
      

  3.   

    where 
    billId='SZ200302090001' 
    and billid not in (select top 2 billid from billhistory billId='SZ200302090001')
      

  4.   

    注意,其实就是把 select top 语句写两遍,第二遍包含了第一遍,然后把是第一遍中的记录用not in剔除就可以了,所以两个where都必须包含相同的外加条件。asp 中经常用来写 pageno 的程序,因为直接用ado的pagesize如果遇上几十万数据,用pagesize就完蛋喽。