Create PROCEDURE getuser
(
IN pageIndex INT,
IN pageSize INT,
OUT count INT
) BEGIN
declare pindex int DEFAULT (pageIndex-1)*pageSize; select * from lc_user order by id LImit pindex,pageSize; SELECT COUNT(id) INTO count from lc_user; END
调用:
CALL getuser(1,10,@count);
select @count;
结果集: