0
CREATE DEFINER=`root`@`localhost` PROCEDURE `bill`(subid int(10), uprice float, sd date, ed date)
BEGIN
declare numberofdays int;
declare totalprice float;
set numberofdays = datediff(ed,sd);
set totalprice= numberofdays*uprice;
insert into invoice (subscriptionid,price_perunit,numberofdays,totalprice)
values (subid, uprice,numberofdays,totalprice);
你能解釋一下你在做什麼嗎? – Marjeta 2013-04-25 15:48:24
問題是什麼? – Devart 2013-04-25 16:04:45