数据库中有四个字段  id  (主键)   字段A   字段B    字段C
我现在要查询表里所有的A=1  或者 B=2  或者 C=3  的所有的数据

解决方案 »

  1.   

    select * from table where A=1 or B=2 or C=3
      

  2.   

    select * from table where A=1
    union all
    select * from table where B=2
    union all
    select * from table where C=3
      

  3.   

    select * from table where A=1 or B=2 or C=3
      

  4.   

    select * 
    from tb 
    where A=1 or B=2 or C=3
      

  5.   

    select * from tbwhere A=1
    union 
    select * from tb where B=2
    union 
    select * from tb where C=3
      

  6.   

    SELECT * FROM TB WHERE A=1 OR B=2 OR C=3
      

  7.   

    SELECT * FROM TB WHERE 
    EXISTS(SELECT 1 FROM TB WHERE A=1) OR 
    EXISTS(SELECT 1 FROM TB WHERE B=2) OR
    EXISTS(SELECT 1 FROM TB WHERE C=3)
      

  8.   


    select * from tb where A=1 or B=2 or C=3
      

  9.   


    select * from table where A=1 or B=2 or C=3
      

  10.   

    select * from tb where A=1 or B=2 or C=3
      

  11.   

    select * from YourTable where A=1 or B=2 or C=3
      

  12.   


    select * from tb where A=1 or B=2 or C=3select * from tb where A=1
    union 
    select * from tb where B=2
    union 
    select * from tb where C=3
      

  13.   

    select A,B,C FROM <table> where A =1 OR B=2 OR C=3