啊哈条子 2017-02-04 10:41 采纳率: 50%
浏览 5044
已采纳

mysql select from where and or 语句问题

数据表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);
这么写选不出来,求正确写法,谢谢

  • 写回答

3条回答 默认 最新

  • 战在春秋 2017-02-04 12:30
    关注

    感觉没问题啊。

    这个试试?

     select * from table where a=1 and b=1 and (c=1 || d=1);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?