471,059 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,059 software developers and data experts.

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 1547
"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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.