you have to write this syntex for executing your custom query..
$db->getAdapter()->query('delete
from users
where id not in(
select * from(
min(n.id)
from users n
group by n.email
)x)');