title: Update same table with IF ELSE Condition in MySQL
body: <p>I am trying to update the <code>user_status</code> filed with condition: </p>
  
  <pre><code>update pm_users 
      set user_status = if ( 
        (select u.user_status from pm_users u where u.user_id = 3
        ) = '1', '0', '1' )
      where user_id = 3
  </code></pre>
  
  <p>means if <code>user_status = 1</code> then update the status with 0 and if user status is 0 then with 1.</p>
  
  <p>I am getting the error: <code>You can't specify target table 'pm_users' for update in FROM clause</code> </p>
  
  <p>I think it means i can't use this query like above for the same table? I am not sure.<br>
  Please help me to move on the right way, and make me correct.</p>