我有以下查询,我为了简单而缩短
SELECT
@WD:=WORKDAYS(
if(completionDate='0000-00-00 00:00:00',
CURDATE(),
completionDate
),d.recievingdate
) AS workingDays,
@QDays:=IFNULL(QDays,0) as Q,
@RDDays:=IFNULL(RDDays,0) As R,
@onhold:=IFNULL(ONHOLD,0) as OnHold,
@TDAY:=IF((@WD-@RDDays-@QDays)<=0,1,ROUND(@WD-@RDDays-@QDays)) as TDay,
@TDAY,
@SLA:=slatime(
d.department,
p.activitytype,
slaitemId,
@sladays:= (SC1+SC2+SC3+SC4+SC5+SC6+SC7+SC8+SC9)
) as slaTime,@SLA,
IF(@TDAY<=@SLA,'OK','NOK') AS SLACOMPLIANCE
以下是结果
PhpMyadmin结果
Mysql Workbench结果
工作台结果与预期相同,因为TDay
小于SlA
相同的查询给出了不同的结果,现在我已经忘记了PHP
也给出了与phpmyadmin
相同的结果
我做错了什么?
注意:WORKDAYS
和slatime
是两个自定义函数