While I can read that the person who posted this message has solved their
issue, this might be worthwhile still.
One thing I notice is that all responses are processing very record to see
if a duplicate record is there. Hopefully though the database server is a
little more powerful than the machine running the script so why not do the
hash match there?
Use something like this as the record source for items with duplicate email
addresses:
select *
from table
where email in (
select email
from table
group by email
having count(*) > 1)
and delete every second record.
-----Original Message-----
From: mickalo@bellsouth.net
Sent: Sunday, August 12, 2001 10:49 PM
To: dbi-users@perl.org
Subject: Removing duplicate records - OT
Hello all,
Sorry about the off-topic question, but this has been driving
me nuts. I am
trying to import a tab delimited file into a MySQL database
and need to remove
duplicate email addresses, before importing the data. The file
is setup like
this:
id1 user1 pass1 email1 name1 na 1 na
id2 user2 pass2 email2 name2 na 0 na
id3 user3 pass3 email2 name3 na 1 na
id4 user4 pass4 email name4 na 1 na
....etc
now I need to go thru each data record in the file and remove
all duplicate
records where the email address is the same. IE above, id2 has
the same email
address and id3 so I want to remove id3.. and so on. the file
is sorted by the
id value.
Any help much appreciated.
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.comTel: 1(225)686-2002
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
__________________________________________________________________________
Please Note :
Only the intended recipient is authorised to access or use this e-mail.
If you are not the intended recipient, please delete this e-mail and notify
the sender immediately. The contents of this e-mail are the writer's
opinion and are not necessarily endorsed by the Gunz Companies
unless expressly stated.
We use virus scanning software but exclude all liability for viruses or
similar in any attachment.