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
Orlando, Florida, USA

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


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


Sorry, only registered users may post in this forum.

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.