sql语言的分页查询

在 MySQL 中表示为:

select * from userlist  order by userId limit n,m

MS SQL Server 中 :
select top (m-n) * from userList where userid not in
(select top  n userid from userList  order by userid) order by userid

Oracle 中 :
select * from (select rownum no,* from userlist where rownum<=m) where no>=n;

 

注意:order by 后面的字段最好是主键或是唯一值了

你可能感兴趣的:(sql语言的分页查询)