OK - here is an example (this is a table containing archives of mailing
lists - the code will show me all subjects that have more than one mail
associated with them, and how many mails there are for the subject...
SELECT Subject, COUNT(UID) AS NumDupes
FROM tblmailingListMessages
GROUP BY Subject
HAVING (COUNT(UID) > 1)
If there was more than one field that needs to be checked to see whether it
is a dupe, include it in the Select statement, and the Group By statement...
HTH
Dan
-----Original Message-----
From: Palyne Gaenir [mailto:[EMAIL PROTECTED]]
Sent: 24 May 2001 07:28
To: SQL
Subject: Listing duplicated records
I have an app where sometimes sometimes entries get duped, and I want
to run a utility to display all those records. I was looking through
count/sum/distinct functions but I'm not sure what to do here. I
want to say, "look through this table. Look at all the entries in
these two fields. If there is more than one record in this table
with the same values in those two columns as any other record, list
all those records for me." I don't even know where to start here,
since I don't actually have any particular value to WHERE by. Has
anybody ever done this?
Best regards,
PJ
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists