Home >Database >Mysql Tutorial >mysql存储过程写分页程序_MySQL
bitsCN.com
mysql存储过程写分页程序 /*分页程序*/delimiter //drop procedure if exists sp_page;create procedure sp_page( p_table_name varchar(1024), p_fields varchar(1024), p_page_size int, p_curr_page int, p_order_string varchar(256), p_where_string varchar(1024), out p_total_rows int ) not deterministic sql security definer comment '分页存储过程' begin /*变量的申明*/ declare v_start_row int default 0; declare v_limit_string varchar(256); /*给变量赋值*/ if p_curr_page