SELECT @rownum :=@rownum + 1 rownum,name
FROM
(SELECT @rownum := ((pageNo-1)*pageSize),name
FROM
mytest
LIMIT (pageNo-1)*pageSize,pageSize
) t
select *from
( select *
from
(select *
from emp
where sal is not null
order by sal desc)a
where rownum<=3*3
order by sal )a
order by sal desc
limit 0,3
select * from table limit m,n其中m是指记录开始的index,从0开始,表示第一条记录
n是指从第m 1条开始,取n条。
select * from tablename limit 100,50
即取出第101条至第150条,50条记录
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)