双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

MYSQL存储过程 新手求指教!!!

LOVE-漂泊 LOVE-漂泊 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
create procedure sp3(in p1 int , in p2 int , in p3 VARCHAR,out p int)
begin

if p2=0 & p3='' then
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1;
elseif p2=0 & p3!='' then
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1 and CONCAT(b_periods,b_betCount,b_winningCount,b_amountCount,s_stype,s_sname,b_status) LIKE '%"+p3+"%';
elseif p2!=0 & p3='' then
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1 and lt_typeid=p2;
elseif p2!=0 & p3!='' then
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1 and lt_typeid=p2 and CONCAT(b_periods,b_betCount,b_winningCount,b_amountCount,s_stype,s_sname,b_status) LIKE '%"+p3+"%';
end if;
select count;

end

这个存储过程哪里错了??
...全文
评论 21
收藏 已收藏
分享
返回顶部
LOVE-漂泊
Web 开发 81,108 成员 341,721 内容