SQL查询100到200行

--SQL Server
--top
select top 100 * from table
where id is not in(select top 100 id from table)
--row_number()
select r.*, row_number() over(order by id desc) as r from table where r>100 and r<=200


--MySQL
--limit
select * from  table limit 100,200;


--Oracle
--rownum
select * from (select rownum r,t.* from table t) where r>100 and r<=200;

Comments are closed.