|
 |
access thread: How to delete duplicates
Message #1 by "Ryan Passey" <rgpassey@y...> on Thu, 13 Mar 2003 22:04:32
|
|
Hi All,
This is a general database question. I am trying to find out how to
delete duplicate rows in a database column. Basically I have an online
drawing, by way of an email collection form, and greedy people submit
their email addresses multiple times. These address are put in a
database, including the duplicates. How can I automatically delete these
duplicates? (so far, I've had to search and delete them manually!) I can
use Quatro Pro, or Microsoft Excel. Any thoughts?
Message #2 by "Tech_Mark" <tek_mark@h...> on Thu, 13 Mar 2003 19:11:25 -0500
|
|
Ryan--No need to export the data
I have a Client Table with duplicate LastNames. CLIENTS ={ClientID,
LastName,...}
To find the duplicates, I do
SELECT CLIENTS.ClientID, CLIENTS.LastName INTO Dups
FROM CLIENTS, CLIENTS AS CLIENTS_1
WHERE (((CLIENTS.ClientID)>[clients_1].[clientID]) AND
((CLIENTS.LastName)=[clients_1].[lastname]));
This will save a list of all of the duplicates (only one of the duplicates
will be selected because of (((CLIENTS.ClientID)>[clients_1].[clientID])
into a Dups table. If you want to purge all of the duplicates, then just
leave this out. You can then use the result to delete dups with
DELETE *
FROM CLIENTS INNER JOIN Dups ON CLIENTS.ClientID = Dups.ClientID;
Mark
----- Original Message -----
From: "Ryan Passey" <rgpassey@y...>
To: "Access" <access@p...>
Sent: Thursday, March 13, 2003 10:04 PM
Subject: [access] How to delete duplicates
> Hi All,
> This is a general database question. I am trying to find out how to
> delete duplicate rows in a database column. Basically I have an online
> drawing, by way of an email collection form, and greedy people submit
> their email addresses multiple times. These address are put in a
> database, including the duplicates. How can I automatically delete these
> duplicates? (so far, I've had to search and delete them manually!) I can
> use Quatro Pro, or Microsoft Excel. Any thoughts?
|
|
 |