0

我想做的伪查询如下:

Select * from mytable where (myintvalue = 0 OR 1) AND anothervalue = "SomeValue"

上面的正确语法是什么?

4

3 回答 3

1

使用IN子句

Select * from mytable where myvalue IN( 0,1) AND anothervalue = "SomeValue"
于 2013-06-07T16:07:56.287 回答
1
WHERE (myintvalue = 0 OR myintvalue = 1)
/* or */
WHERE myintvalue IN (0, 1)
于 2013-06-07T16:08:08.737 回答
1
SELECT * FROM mytable where (myintvalue = 0 OR myintvalue = 1) AND anothervalue= 'SomeValue';

或者

SELECT * FROM mytable where myintvalue in (0,1) AND anothervalue= 'SomeValue';

应该做的伎俩

于 2013-06-07T16:08:09.410 回答