MySQL 高效分页
create PROCEDURE USP_GetByPager( _pageindex int, _pagesize int ) BEGIN declare _currentpageindex int DEFAULT (_pageindex-1)*_pagesize; select a.* from A a inner join ( select id from A order by id limit _currentpageindex,_pagesize) b on a.id=b.id ; end