MySQL Forums
Forum List  »  MySQL Workbench

Re: OR Operator return all table values
Posted by: Jon Stephens
Date: April 30, 2020 10:40AM

id=2 OR 4 always evaluates as true. 4 is nonzero, thus is always true, so your expression is the same as writing id=2 OR TRUE, which is always true. You likely want id=2 OR id=4.

cheers

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: OR Operator return all table values
231
April 30, 2020 10:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.