sql查询第10到20条数据

use Northwind
select   top   10   *   from   orders
 where   orderid > ( select  max(orderid)  from  (select top 10 orderid  from  orders order by orderid) as t  )

 


use Northwind
select top 10 * from [Order details]
where convert(varchar(10),orderid)+convert(varchar(10),productid)
not in(select top 10 convert(varchar(10),orderid)+convert(varchar(10),productid)
from [Order details])

你可能感兴趣的:(sql)