select distinct(t1.b) from table t1,table t2 where t1.a<>t2.a and t1.b=t2.b and and t1.c=t2.c
select b, count(distinct c) c_cnt, count(distinct d) d_cnt, count(distinct e) e_cnt, from table_name where c_cnt = 1 and d_cnt = 1 and e_cnt = 1 group by b;
上面的写错了。不好意思,呵呵 select b from (select b, count(distinct c) c_cnt, count(distinct d) d_cnt, count(distinct e) e_cnt from a group by b) where c_cnt = 1 and d_cnt= 1 and e_cnt = 1;
count(distinct c) c_cnt,
count(distinct d) d_cnt,
count(distinct e) e_cnt,
from table_name
where c_cnt = 1
and d_cnt = 1
and e_cnt = 1
group by b;
select b from (select b,
count(distinct c) c_cnt,
count(distinct d) d_cnt,
count(distinct e) e_cnt
from a
group by b) where c_cnt = 1 and d_cnt= 1 and e_cnt = 1;