i'm trying to delete duplicate regists with this code, but I'vve got this error:
"You can't specify target table 'newsletters_queu' for update in FROM clause "
the code retrives the data I want to delete but doesn't allow me to do it.
DELETE FROM newsletters_queu WHERE (
) NOT IN (
SELECT min( newsletters_queu.id )
GROUP BY newsletters_queu.idnewsletter, newsletters_queu.idendereco
-- do this once
create table tmp_id (
-- then do this each time you want to do the delete
delete from tmp_id;
SELECT min( id )
DELETE FROM newsletters_queu
WHERE id not in ( select id from tmp_tab);