81,092
社区成员
发帖
与我相关
我的任务
分享
if (p2=0) AND (p3='')
if (p2=0 & p3='')
create or replace procedure sp3(in p1 int , in p2 int , in p3 VARCHAR,out p int) is
begin
if p2=0 and p3='' then
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1;
else if p2=0 and 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+"%';
else if p2!=0 and 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;
else if p2!=0 and 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