WHERE operation = 'cmn'
AND client = '' OR client IS NULL
AND ts >= '2014-03-01'
AND ts <'2014-09-01'
我正在尝试此where
条件,但是OR未按预期工作。
我的想法是保持cmn强制性,但客户端可能为空或无效。
我该怎么做?
答案 0 :(得分:5)
将or
括在括号中:
WHERE operation = 'cmn'
AND (client = '' OR client IS NULL)
AND ts >= '2014-03-01'
AND ts < '2014-09-01'