title: #1442 - Can't update table 'sale_price' in stored function/trigger because it is already used by statement
body: <p>I am trying to update the same table before inserting new row in the table.
  I want to set the status of all previous rows with the same product_id to 0 and after that insert new row with the status 1....Please help. here is my code written mysql.. </p>
  
  <pre><code>DROP TRIGGER IF EXISTS `priceStatusUpdate`//
  CREATE TRIGGER `priceStatusUpdate` BEFORE INSERT ON `sale_price`
   FOR EACH ROW BEGIN
    UPDATE sale_price 
    SET status=0
    WHERE product_id=new.product_id;
  END
  //
  </code></pre>