My sql error: you can't specify target table for update in from clause
<p>I'm getting this error but I can not figure out where I can have it done.</p>

<pre><code>DELETE E.* 
 FROM Esordio E NATURAL JOIN (
                              SELECT *
                              FROM Esordio E2
                              WHERE E2.Patologia = 'Otite'
                                    AND E2.DataGuarigione IS NOT NULL
                                    AND YEAR(E2.DataGuarigione) &lt; YEAR(CURRENT_DATE) - 5
                                    AND EXISTS
                                             ( 
                                              SELECT *
                                              FROM Esordio E3
                                              WHERE E3.Paziente = E2.Paziente
                                              AND E3.Patologia = E2.Patologia
                                              AND YEAR(E3.DataEsordio)&gt;YEAR(CURRENT_DATE)-5
                                             )
                                  ) AS Target;
</code></pre>