我有一条 SQL 语句:
UPDATE informix.dv_billing dv
SET dv.fee = CASE WHEN ((SELECT dc.mm_discount
FROM dv_mm_disc dc
WHERE dc.year = YEAR(dv.tdate)
AND dc.quarter = quarter(dv.tdate)
AND dc.bid=dv.bid
AND dc.mm_code=dv.pcode
AND dc.ins=dv.ins) = 0)
THEN dv.fee ELSE 0
END
WHERE MDY(MONTH('2012-04-05'), 1, YEAR('2012-04-05')) - 2 UNITS MONTH
AND last_day(DATE('2012-04-05'))
;
SQL 返回错误:
Result of a boolean expression is not of boolean type.
有什么问题?