ok, capito. diciamo che avresti potuto fare tutto con un'unica query (qualcosa del tipo DELETE ... JOIN )