时间:2021-07-01 10:21:17 帮助过:2人阅读
CREATE PROCEDURE get_trees(in conditions varchar(2048), in fields varchar(2048) , in sort char(255), in start int, in num int)
BEGIN
/* 获得10条记录 */
SET @sql = CONCAT(’SELECT ‘, fields, ‘ FROM Persons WHERE ‘, conditions, ‘ ORDER BY ‘, sort, ‘ LIMIT ‘, start, ‘,’, num);
PREPARE sqlstmt FROM @sql;
EXECUTE sqlstmt;
DEALLOCATE PREPARE sqlstmt;
END//
delimiter ;