SELECT *
FROM tb
where not exists(select 1 from tb as t
where t.c1 = tb.c1 or t.c1 is null and tb.c1 is null) group by c1 having sum(c2) > 0)
...全文
686打赏收藏
关于数据是否属于某个分组
我是这样写的不知道有没有漏洞 sSELECT * FROM tb where not exists(select 1 from tb as t where t.c1 = tb.c1 or t.c1 is null and tb.c1 is null) group by c1 having sum(c2) > 0)