By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,967 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,967 IT Pros & Developers. It's quick & easy.

Remove identical records from the same table

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
"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.