为什么查询在destCurrency不为0时给出结果 -

时间:2015-06-19 17:57:49

标签: mysql

SELECT * 
FROM xyz 
WHERE applyat = 'anita' 
    AND applyAt = 'Create' 
    AND country = '50' 
    AND  dest_country = '108' 
    AND  originCurrency = 'EUR' 
    AND  destCurrency = 0 AND isEnable = 'Y'  
    AND agentID = 0 
    AND Module = 'abc' 
ORDER BY ruleID DESC 

1 个答案:

答案 0 :(得分:1)

您应该添加引号,因为它是varchar

SELECT * FROM xyz WHERE applyat = 'anita' AND applyAt = 'Create' AND country = '50' AND dest_country = '108' AND originCurrency = 'EUR' AND destCurrency = '0' AND isEnable = 'Y' And agentID = 0 AND Module = 'abc' ORDER BY ruleID DESC