大神帮我看下要怎样处理。REATE DEFINER = `root`@`localhost` PROCEDURE `addScore` ( _uid INT, _amoun

2020-10-13 社会 413阅读
动态语句要用预处理来做,select 换成 set
CREATE DEFINER=`root`@`localhost` PROCEDURE `getInfo`(
in sip varchar(50),
in dip varchar(50),
out Zgjcs int,
out Zbgjcs int,
out Gjcs int,
out Zfsbs int,
out Zfssjl int,
out Zjsbs int,
out Zjssjl int,
out Fsbs int,
out Fssjl int
)
BEGIN
select Zgjcs = ((select count(*) from Program1 where sip=sip ) + (select count(*) from Program2 where sip=sip));
select Zbgjcs = ((select count(*) from Program1 where dip=dip) + (select count(*) from Program2 where dip=dip));
select Gjcs = ((select count(*) from Program1 where sip=sip and dip=dip) + (select count(*) from Program2 where sip=sip and dip=dip));
select Zfsbs = (sum(a.trigger_times)+sum(b.repeat1)), Zfssjl = sum(b.traffic) from Program1 a, Program2 b where a.sip=sip or b.sip=sip;
select Zjsbs = (sum(a.trigger_times)+sum(b.repeat1)), Zjssjl = sum(b.traffic) from Program1 a, Program2 b where a.dip=dip or b.dip=dip; http://www.lonwin.net" type="text/css">
select Fsbs = (sum(a.trigger_times)+sum(b.repeat1)), Fssjl = sum(b.traffic) from Program1 a, Program2 b where (a.sip=sip and a.dip=dip) or (b.sip=sip and b.dip=dip);
END;
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com