你这个需求是最简单的
select * from table where name = 'abc' and sex = '0'
就能满足你的要求
select *
from tab t1
where exists(Select 1 from tab where name = t1.name and sex = t1.sex and id <> t1.id)
select count(*)-count(distinct 某列) rom tables;
为零则相同
select * from 表名 where name='abc' and sex='0'
就这样就可以实现了
同一楼