how to select update in the same table in mysql?
<p>I have a table called <code>emp(eid, ename, sal, mgr)</code>. Now I want to update the manager salary whose salary is less than 50000/-. </p>

<pre><code>UPDATE emp AS t1 INNER JOIN
(SELECT mgr FROM emp WHERE mgr = t1.empno) AS t2
SET sal = sal + 5000
WHERE t1.sal &lt;50000;
</code></pre>

<p>what should I do?</p>