select distinct a.id,a.name,a.birthdate from a t1, a t2 where t1.birthdate=t2.birthdate and t1.id != t2.id order by a.birthdate
i use this select * from a where birthday in ( select birthday from a group by birthday having count(birthday) > 1) order by birthday
select a.* from tt a inner join (select birthdate from tt group by birthdate having count(*)>=2) b on a.birthdate=b.birthdate
select name, birthdate from a group by name, birthdate having count(*)>1
select distinct a.id,a.name,a.birthdate from a t1, a t2 where t1.birthdate=t2.birthdate and t1.id != t2.id order by a.birthdate 和 select a.* from tt a inner join (select birthdate from tt group by birthdate having count(*)>=2) b on a.birthdate=b.birthdate 数据不完全一致 后者总是多几条 (后者总是有几个只有1条 不重复记录的结果) 反复测试 发现 , 如何调整后者 (后者性能远远大于前者)
from a t1, a t2
where t1.birthdate=t2.birthdate
and t1.id != t2.id
order by a.birthdate
select * from a
where birthday in (
select birthday from a group by birthday having count(birthday) > 1) order by birthday
inner join
(select birthdate from tt group by birthdate having count(*)>=2) b
on a.birthdate=b.birthdate
name,
birthdate
from
a
group by
name,
birthdate
having
count(*)>1
from a t1, a t2
where t1.birthdate=t2.birthdate
and t1.id != t2.id
order by a.birthdate
和
select a.* from tt a
inner join
(select birthdate from tt group by birthdate having count(*)>=2) b
on a.birthdate=b.birthdate
数据不完全一致
后者总是多几条 (后者总是有几个只有1条 不重复记录的结果)
反复测试 发现 , 如何调整后者 (后者性能远远大于前者)