当我在SQl中运行以下select查询时
SELECT Count(*)
FROM workordercurrent
WHERE office_id = 1
AND ( ( scheduleddate = '2018-11-01' )
OR ( schedulestopdate = '2018-11-01' )
OR ( scheduleddate = '0000-00-00'
AND orderdate = '2018-11-01' ) )
AND worktype <> 6
查询返回694作为正确的计数
当我用两个输入参数在SQL过程中编写相同的查询时
office_id(int) and order_date (DATE)
BEGIN
SELECT Count(*)
FROM workordercurrent
WHERE office_id = office_id
AND ( ( scheduleddate = order_date )
OR ( schedulestopdate = order_date )
OR ( scheduleddate = '0000-00-00'
AND orderdate = order_date ) )
AND worktype <> 6;
END
It returns the count as 3260
这里的问题是什么,因为两个查询完全相同。下面是我如何运行存储过程