用limit 传变量TO 存储过程解决方案(续)
DELIMITER $$
DROP PROCEDURE IF EXISTS `dbase`.`paper` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `paper`(in id int)
BEGIN
/*declare a BIGINT ;
set a=3;*/
prepare stmt from"
select ques_id from exam_question t
where ques_subject='01'
order by rand() limit ?";
set @a=id;
execute stmt using @a;
END $$
DELIMITER ;
http://u.huoban001.com/space.php