限制结果集行数
select top 5 * from emp order by salary desc
(*)检索按照工资从高到低排序检索从第六名开始一共三个人的信息:
select top 3 * from emp where number not in
(select top 5 number from emp order by salary desc)
order by salary desc
sqlserver2005后增加了row_number函数简化实现
本文共 288 字,大约阅读时间需要 1 分钟。
限制结果集行数
select top 5 * from emp order by salary desc
(*)检索按照工资从高到低排序检索从第六名开始一共三个人的信息:
select top 3 * from emp where number not in
(select top 5 number from emp order by salary desc)
order by salary desc
sqlserver2005后增加了row_number函数简化实现
转载于:https://www.cnblogs.com/joesphos/p/5185677.html