求排名前五的数据信息:
实现一:
select distinct top 5 Id,Title,sort from content order by sort DESC
实现二:
select * from (select dense_rank() over(order by sort desc) rank,Id,Title,sort from content ) AS cte where rank < 6
分别对应的结果:
求排名前五的数据信息:
实现一:
select distinct top 5 Id,Title,sort from content order by sort DESC
实现二:
select * from (select dense_rank() over(order by sort desc) rank,Id,Title,sort from content ) AS cte where rank < 6
分别对应的结果: