工资从高到低排序 输出工资是第4到6行数据
select top 3 *
from emp
where EMPNO not in(select top 3 EMPNO from emp order by sal desc)
order by sal desc
工资从高到低排序 输出工资是第13到15行数据
select top 3 *
from emp
where EMPNO not in(select top 12 EMPNO from emp order by sal desc)
order by sal desc
总结 :
假设 每页显示n条记录,当前要显示的第m页
表名是A 主键是A_id
select top n*
from A
where A_id not in(select top(m-1)*n A_id from emp)