一、限制结果集行数
1. Select top 5* from T_Employee order by FSalary DESC
2. (*)检索按照工资从高到低排序检索从第六名开始一共四个人的信息:
select top 4 * from T_Employee where FNumber not in (select top 5 FNumber from T_Employee order by FSalary DESC) order by FSalary DESC
3. SQLServer2005后增加了Row_Number函数简化实现。
时间: 2024-10-24 15:25:19