在SQL查询中不显示前10条记录 [英] not display top 10 record in sql query
本文介绍了在SQL查询中不显示前10条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用sqlserver2005.
如何使用不在表中显示top(10)记录的sql查询.
任何建议或想法,将不胜感激.....
mukesh
Hi,
I am using sqlserver 2005.
How to use sql query that not display top(10) record in table.
any suggestion or idea, help will be appreciated........
mukesh
推荐答案
一旦我解决了以下查询:
once i solved such query as:
with cte as (
SELECT * ,
ROW_NUMBER () over (order by CountryId ) as rn
FROM Country )
SELECT * FROM cte
WHERE rn>10 ;
这里的CountryId只是表的主键
here CountryId is just the primary key of the table
这篇关于在SQL查询中不显示前10条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文