MYSQL存储过程 新手求指教!!!
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
这个存储过程哪里错了??
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
这个存储过程哪里错了??
...全文
相关推荐
mysql存储过程实例
MySQL 存储过程实例MySQL 存储过程实例详细介绍了 MySQL 存储过程的开发步骤,本节将通过具体的实例讲解 PHP 是如何操纵 MySQL 存储过程的。
MySQL存储过程 MySQL存储过程
### MySQL存储过程详解#### 一、MySQL存储过程概述MySQL 存储过程是一种服务器端的编程技术,它允许开发者创建可重复使用的代码模块。
mysql存储过程实现分页
总之,利用MySQL存储过程实现分页是一个非常实用且高效的方法。
mysql存储过程mysql存储过程
### MySQL存储过程详解#### 一、概述MySQL 存储过程是一种预编译的 SQL 代码块,它能够接受输入参数,返回单个或多个结果,并可包含复杂的流程控制逻辑。
理解MySQL存储过程和函数
MySQL存储过程和函数是数据库管理中的重要组成部分,它们允许开发者编写可重用的代码段,提高效率并减少网络流量。本篇文章将深入探讨这两个概念,以及如何在MySQL中创建和使用它们。


Web 开发

