Mysql Select未在过程中应用where子句
我试图在一个过程中执行此查询Mysql Select未在过程中应用where子句,mysql,Mysql,我试图在一个过程中执行此查询 set mailSeq = ( select MailSequence from MailIdentity where Customer = customer and MailDate = mailDate ); 我在这张表中有4条记录 Id Customer MailDate MailSequence 1 1 2014-04-05 00:00:00 5 2 1 2014-04-06
set mailSeq = (
select MailSequence
from MailIdentity
where Customer = customer
and MailDate = mailDate
);
我在这张表中有4条记录
Id Customer MailDate MailSequence
1 1 2014-04-05 00:00:00 5
2 1 2014-04-06 00:00:00 2
3 2 2014-04-05 00:00:00 9
4 2 2014-04-06 00:00:00 5
我把这个过程称为
请致电我的程序2“2014-04-05”
参数为客户和邮件日期
如果我在过程之外执行查询,它将返回一条记录,即我想要的记录,但当我调用过程时,它将返回4条记录
对此有什么帮助吗?我也遇到了这个问题,我发现where后面的参数:
like where Customer = customer
and MailDate = mailDate
左边和右边是一样的,所以哪里永远是真的我有同样的问题,读了这篇文章后,我意识到这是什么。不要让输入参数与where子句中的字段名同名