sql/reports [message #79161] |
Wed, 08 May 2002 01:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kishur
Messages: 1 Registered: May 2002
|
Junior Member |
|
|
hello experts,
i know i am in the wrong forum for this one, but please excuse me.
I have a table called PEOPLE, here are the columns
DOB,
SURNAME,
GENDER
what would be the best way to find all people with the same surname, dob, and gender?
Any ideas with performance in mind as the overiding issue?
Any help would be great.
Thanks experts,
k.
|
|
|
Re: sql/reports [message #79164 is a reply to message #79161] |
Wed, 08 May 2002 02:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Remash
Messages: 52 Registered: November 2000
|
Member |
|
|
select a.dob, a.surname, a.gender from (select dob, surname, gender from PEOPLE) a,
(select dob, surname, gender, count(1) from PEOPLE having count(1) > 1 group by dob, surname, gender) b
where a.dob=b.dbo and a.surname=b.surname and a.gender=b.gender
|
|
|
|