MySQL增加行号rownum
select * from ( select @rownum:=@rownum+1 AS rownum, app_t.* from ( select * from app_custom where 1=1 ) app_t,(SELECT @rownum:=0) r ) as t where t.rownum between 1 and 10
![](https://images.cnblogs.com/cnblogs_com/qianjinyan/910455/o_jasmine%20love.gif)
select * from ( select @rownum:=@rownum+1 AS rownum, app_t.* from ( select * from app_custom where 1=1 ) app_t,(SELECT @rownum:=0) r ) as t where t.rownum between 1 and 10