应该很简单呀 select count(distinct(t1.A)) from table t1, table t2 where t1.A=t2.A and t1.B !=t2.B
美女天下
2024-05-06 04:40:17
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
薄荷凉我心
2024-05-06 16:42:00
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 ' )
软耳兔兔
2024-05-06 16:29:19
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