开发者

Why is this mysql syntax wrong

开发者 https://www.devze.com 2023-03-13 08:43 出处:网络
I am executing the follow mysql query and getting error saying wrong syntax. SELECT COUNT(*) FROM PS.INFO WHERE IPADDRESS=\'1.1.1.1\' AND ID=\'YYY\' AND (TYPE=\'PAID\' 0RTYPE=\'FREE\') AND EXPIRYTIME

I am executing the follow mysql query and getting error saying wrong syntax.

SELECT COUNT(*) FROM PS.INFO WHERE IPADDRESS='1.1.1.1' AND ID='YYY' AND (TYPE='PAID' 0R  TYPE='FREE') AND EXPIRYTIME IS NULL;

Please help me out with the correct s开发者_如何学编程yntax?


Your wrote 0R (zero-R) instead of OR (O-R).


TYPE='PAID' 0R TYPE='FREE'

OR 

appears to have a zero instead of an O


The error always tells you where to look. In this case it says "near '0R..."

And sure enough, that's a zero, not an O. It should be the word OR.

0

精彩评论

暂无评论...
验证码 换一张
取 消