几个关于取从第一行到第几行数据
select top 5 ID from ActionInfo where ID not in (select top 20 ID from ActionInfo order by ID) order by ID select top 5 ID from ActionInfo where not exists (select * from (select top 20 ID from ActionInfo order by ID) a where a.ID=ActionInfo.ID ) order by ID select 1 from (select top 20 ID from ActionInfo order by ID) as aa --where aa.ID=[OADB].[dbo].[ActionInfo].ID select top 5 ID from ActionInfo where ID > (select max(ID) from (select top 20 ID from ActionInfo order by ID) a ) order by ID select top 5 ID from ( select row_number() over (order by ID) as rownumber,* from ActionInfo ) a where rownumber > 20 order by ID WITH sss AS( SELECT *,ROW_NUMBER() OVER(ORDER BY ID) AS rowNum FROM ActionInfo ) SELECT * FROM sss WHERE rowNum BETWEEN 11 AND 20
人各有命,上天注定,有人天生为王,有人落草为寇。脚下的路,如果不是你自己的选择,那么旅程的终点在哪,也没人知道。你会走到哪,会遇到谁,都不一定。

浙公网安备 33010602011771号