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
.
精彩评论