title: MySQL insert on duplicate key; delete?
body: <p>Is there a way of removing record on duplicate key in MySQL?</p>
  
  <p>Say we have a record in the database with the specific primary key and we try to add another one with the same key - <code>ON DUPLICATE KEY UPDATE</code> would simply update the record, but is there an option to remove record if already exists? It is for simple in/out functionality on click of a button.</p>