MySql简单分页存储过程

BEGIN

	DECLARE startIndex int;

	select COUNT(*) INTO RecordCount from test;
	
	SET startIndex = (PageIndex - 1) * PageSize;
	SELECT * FROM test ORDER BY id DESC LIMIT startIndex,PageSize ;
END

  

原文地址:https://www.cnblogs.com/byxxw/p/4892252.html