select * from table1 t where (select count(1) from table1 where b=t.b and c in(1,2,3,4))>=2

解决方案 »

  1.   

    倒,没看懂
     5    NO2    1      *      *      * 
        6    NO2    2      *      *      * 
    NO3的因为字段C只有满足其中一个条件=1,不够至少两个条件,所有NO3的不选出来。 
    NO2的字段c满足的1和2 怎么能出来?
      

  2.   

    select * from table1 t where (select count(1) from table1 where b=t.b and c in(1,2,3,4))>=2 
    and c in(1,2,3,4)
      

  3.   

    NO2满足字段C的至少两个条件阿,C=1,C=2,C=3,C=4,中的2个阿,所以要出来.
    但是NO3只满足1个,不够2个,所以不要出现NO3