select*from a
where a in (select a from a groupby a havingcount(a)>1)
or b in (select b from a groupby b havingcount(b)>1)
select*from a
where (a in (select a from a groupby a havingcount(a)=1)
or b in (select b from a groupby b havingcount(b)=1))
and a<>''and b<>''