468,468 Members | 2,737 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,468 developers. It's quick & easy.

Remove identical records from the same table

Hi All,

I have a table with the following information: ID, Name, Address, Field4
In this table it happens to have duplicate records with identical Name and
Address but different content in Field4. I want to find how it is possible
to build a query which will remove records which have identical Name and
Address (Field4 may vary in content and I don't care which of the duplicate
records will be kept)

Regards,
Nicolae
Nov 13 '05 #1
1 1472
"Nicolae Fieraru" <no****@please.cxm> wrote in message
news:40********@duster.adelaide.on.net...
Hi All,

I have a table with the following information: ID, Name, Address, Field4
In this table it happens to have duplicate records with identical Name and
Address but different content in Field4. I want to find how it is possible
to build a query which will remove records which have identical Name and
Address (Field4 may vary in content and I don't care which of the duplicate records will be kept)

delete a
from Table1 as a
where a.ID >
(
select min (b.ID)
from Table1 b
where b.[Name] = a.[Name]
and b.Address = a.Address
)
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Agnes | last post: by
1 post views Thread by Paul Wagstaff | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.