Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Your query is flawed at it's root.
Doing something like that will delete EVERY OCCURENCE of an email who is present several times in your table, not just the superfluous occurences.
I don't think you can do that without procedural language or php/asp/whatever...
You didn't specified which DB you are working on, so it may not work.
This was tested in postgresql:
Code:
delete
from emailsuk2 as em1
where 1< (
select count(email)
from emailsuk2 as em2
where em1.email=em2.email
group by email
);
__________________
Only a biker knows why a dog sticks his head out the window.
Last edited by tripy; 06-27-2008 at 08:39 AM..
|