即对应于sql server的下列语句怎么改写到sybase中适用?
select top 20 * from Products 
         where ( ProductID not in 
                             ( select top 10 ProductID from Products 
                                      where (ProductID > 3 and ProductID< 200) order by ProductID)  ) 
        and (ProductID > 3 and ProductID< 200)  
         order by ProductID

解决方案 »

  1.   

    select top 30 * from 表 where id>100 and id not in (select top 20 id from 表 where id>100)
      

  2.   

    select top 10 * from 表 where id>100 and id not in (select top 20 id from 表 where id>100)
      

  3.   

    to  pengdali(大力 V3.0) :
    该语句能在Sybase中用吗?ps:Sybase人气太低,借MSSQL问问
      

  4.   

    我现在想建一个临时表,该表在除原表的字段上增加一个新字段id为自动增长
    然后在这个临时表中根据这个id来找出所要的数据段不知道上述过程怎么用sql语言实现?