是否可以简写mySQL where子句并说:
SELECT * FROM table WHERE (animal = cat OR dog OR bird)
而不是说:
SELECT * FROM table WHERE (animal = cat OR row = dog OR row = bird)
由于
答案 0 :(得分:2)
您正在寻找的是IN
运营商。
SELECT * FROM table WHERE animal in ('cat','dog', 'bird')