数据表table中有字段a,b,c,d。其中字段a,b值为0或1;c,d值为0或1。现在使用select语句,筛选出ab字段为1,cd字段有一个为1。
select * from table where a=1 and b=1 and(c=1 or d=1);
这么写选不出来,求正确写法,谢谢

mysql select from where and or 语句问题
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- 战在春秋 2017-02-04 12:30关注
感觉没问题啊。
这个试试?
select * from table where a=1 and b=1 and (c=1 || d=1);
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报