[英]How to do a X or Y in where query mysql for a single variable?
我想做的偽查詢如下:
從mytable中選擇*,其中(myintvalue = 0或1)AND anothervalue =“ SomeValue”
上面的正確語法是什么?
使用IN
子句
Select * from mytable where myvalue IN( 0,1) AND anothervalue = "SomeValue"
WHERE (myintvalue = 0 OR myintvalue = 1)
/* or */
WHERE myintvalue IN (0, 1)
SELECT * FROM mytable where (myintvalue = 0 OR myintvalue = 1) AND anothervalue= 'SomeValue';
要么
SELECT * FROM mytable where myintvalue in (0,1) AND anothervalue= 'SomeValue';
應該做的把戲
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.