skij
asked on
MySQL: Simplifiying long list of ORs
Using MySQL, is there a better, faster, more simple way to do this?
SELECT * FROM `x` WHERE `y`=1 OR `y`=2 OR `y`=5 OR `y`=7 OR `y`=8
Something like this?
SELECT * FROM `x` WHERE `y` is (1,2,5,7,8)
SELECT * FROM `x` WHERE `y`=1 OR `y`=2 OR `y`=5 OR `y`=7 OR `y`=8
Something like this?
SELECT * FROM `x` WHERE `y` is (1,2,5,7,8)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.