Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Multiple duplicate addresses SQL help?
I need to pull out values from two tables, that contain mustiple address
duplicates.
The basic table structure is (without uneeded fields):
entity_address
entity_address_id
address_id
end_date
address
address_id
street1
street2
city ....etc
I need to select the addresses that are duplicates for each
entity_address, not having an end date of null (the only current
address)
So for each entity, I get all their entity_addresses. Of those, I need
to get ones that have the same street1, street2, city etc to
otheraddresses for that entity, except for the ones that have
end_date=null.
My problem is: How can I group together only the addresses that have
dupes?
I tried a query that had
group by street1
having count(street1) > 1 but that didn't get me the desired results.
Any suggestion on how to grab these?
Thanks
Bob Maggio
Received on Thu Aug 23 2001 - 13:09:08 CDT