SQL Server中的分页查询
假设每页显示n条记录,当前显示的是第m页,表名是A,主键是A_id
select top n *
from A
where A_id not in (select top (m-1)*n A_id from A)
sal从高到低排序,输出10-12条记录的信息
(因为没有第12条记录,所以只显示了2条)
select top 3 *
from emp
where sal not in (select top 9 sal from emp order by sal desc)
order by sal desc