【发布时间】:2014-12-31 08:11:29
【问题描述】:
MySQL 存储过程将执行,但条件不起作用。有人可以解决这个问题吗?
空值未检查or 条件。是否需要替换or?
DELIMITER $$
CREATE DEFINER=`rebar`@`%` PROCEDURE `SearchInProgress`(
ClientID bigint,
GCName varchar(250),
TeamID int,
USPMID Bigint,
JobReceivedDate datetime,
importanceID Bigint
)
begin
select * from jobdetails
where
(clientid = ClientID or ClientID = "") and
(GCName = GCName or GCName ="") and
(TeamID = TeamID or TeamID ="") and
(ReceivedDate = JobReceivedDate or JobReceivedDate = "") and
(ImportanceID = importanceID or importanceID = "") and
(JobID in (select jobid from JobCoordinatorDetails where USProjectManagerID = USPMID) );
end
【问题讨论】:
标签: mysql stored-procedures scope mariadb