Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Select未在过程中应用where子句_Mysql - Fatal编程技术网

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子句中的字段名同名