select * from table where a1=1 or a2=2 or a3=3

解决方案 »

  1.   

    加上括号就行了:
    a1=1 and (a2=2 or a3=3)
      

  2.   

    可以这样写
    where (if1 and if2) or (if1 and if3)
      

  3.   

    a1=1 and (a2=2 or a3=3)
      

  4.   

    select * from table where a1=1 or a2=2 or a3=3
      

  5.   


    这种情况有时对有时错;最好用上面那种
    where if1 and (if2 or if3)
      

  6.   

    select * from table where a1=1 and (a2=2 or a3=3)不过你写得也对呀
    select * from table where a1=1 and a2=2 or a3=3