personally, i'd just use perl:
my @deademails = ("long", "list", "of", "emails");
take the output of:
select email from table
drop that into another array (@allemails)
then do a for loop through all the emails
checking to see if each line of @allemails matches any line of @deademails
if it does
kill it
for (my $i = 0; $i <= scalar(@allemails) - 1; $i++) {
for (my $x = 0; $x <= scalar(@deademails) - 1; $x++) {
$killit = 1 if $allemails[$i] eq $deademails[$x];
}
if ($killit) {
<enter delete query here>
}
}
wo
that's way more complicated than it has to be
you could also just loop through all @deademails
and do a delete from table where email='$deademails[$i]'
for (my $i = 0; $i <= scalar(@deademails) - 1; $i++) {
<delete statement for $deademails[$i]>
}
either way should work
i only kept the top one 'cause i spent so long writing it
it would just seem wrong to delete it all now....
good luck :)
_________________________________
daniel a. g. quinn
starving programmer
corporation, n.
an ingenious device for obtaining individual profit without individual
responsibility.
- ambrose bierce
----- Original Message -----
Sent: Wednesday, July 10, 2002 3:20 PM
Subject: Mass Delete
| I have about 40,000 email addresses in a MySQL database.
|
| I also have a list of 1500 email addresses that need to be removed.
|
| I am searching for a way to delete these 1500 email addresses en masse,
| but I have come up short.
|
| I sure would appreciate a nudge in the right direction from somebody who
| might be in the know.
|
| Thanks,
| Robert
|
|
| ---------------------------------------------------------------------
| Before posting, please check:
| http://www.mysql.com/manual.php (the manual)
| http://lists.mysql.com/ (the list archive)
|
| To request this thread, e-mail <[EMAIL PROTECTED]>
| To unsubscribe, e-mail
<[EMAIL PROTECTED]>
| Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
|
|
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php