第一比較傻的方法
select * from (select top (m-n+1) * from (select topm * from 表) a order by a.Id desc) b order by b.Id第二有技術(shù)含量的方法
select * from (select *,ROW_NUMBER() over (order by id)px from 表)as t where px>n and px<=m
第三種換個(gè)思路
select top m-(n-1) * from 表 where id not in (select top n-1 id from 表 order by Id) order by Id
--查詢n到m行的數(shù)據(jù)
你是哪個(gè)...
誰還有其他方法歡迎留言
加點(diǎn)內(nèi)容
查詢表內(nèi)最新的標(biāo)識(shí)列 有時(shí)候很有用select IDENT_CURRENT('表名')
新聞熱點(diǎn)
疑難解答
圖片精選