第1个回答 推荐于2018-05-14
应该很简单呀
select count(distinct(t1.A))
from table t1, table t2
where t1.A=t2.A and t1.B !=t2.B本回答被提问者和网友采纳
第2个回答 2009-03-09
SELECT COUNT1+COUNT2 FROM
(select A,count(*) COUNT1 from table_name where B='True' GROUP BY A) C,
(select A,count(*) COUNT2 from table_name where B='False' OR B='false' GROUP BY A) D
where C.A=D.A
第3个回答 2009-03-09
1楼的回答跟我类似不过纠正下:
select distinct A from mytable where A in
(
select A from mytable where B='true '
) and A in
(
select A from mytable where B='false '
)
第4个回答 2009-03-09
select a, sum(T) as T, sum(F) as F
(select a, case b = 'True' then 1 else 0 end as T,
case b <> 'True' then 1 else 0 end as F
from 表)
group by a
having sum(T) > 0 and sum(F) > 0