title: MySql Trigger, before insert delete a row in the same table
body: <p>Is this possible? Before a row is inserted into tableA, I need to delete any rows in tableA containing duplicate data.The trigger below does not generate an error but doesn't work either. </p>
  
  <pre><code>CREATE TRIGGER remove_old_user
  BEFORE INSERT ON userStatus
  FOR EACH ROW
  DELETE FROM userStatus WHERE username = NEW.username
  </code></pre>
  
  <p>Any ideas?</p>