1.首先创建一个带参数的存储过程
①存储过程名称=proc_bookinfo
②存储过程2个参数 一个in 一个out in参数名称=ispay out参数名称=unPaycount
- DELIMITER $$
- USE `bookshop`$$
- DROP PROCEDURE IF EXISTS `proc_bookinfo`$$
- CREATE DEFINER=``@`` PROCEDURE `proc_bookinfo`(IN ispay VARCHAR(10),OUT unPaycount INT)
- BEGIN
- SELECT COUNT(*) INTO unPaycount FROM tb_bookinfo AS a,tb_shopbook AS b WHERE b.ispay=ispay;
- END$$ </