title: Mysql Update on Update trigger
body: <p>I have a Denormalized database where I have the total points of other table into the driver table. I want to update the total points of the table driver when I update the table where the points are.</p>
  
  <p>Something like this:</p>
  
  <pre><code>CREATE TRIGGER sanciones_trigger BEFORE UPDATE ON points
  FOR EACH ROW
  UPDATE drivers,
      (  SELECT pID,SUM(numpoints) AS total_points
          FROM drivers
          INNER JOIN points ON points.driverID = drivers.pID
          GROUP BY drivers.pID
      ) sum
  SET drivers.total_points= sum.total_points
      WHERE drivers.pID = sum.pID;
  </code></pre>
  
  <p>But I cant Update inside the trigger. I also tried with a procedure, but I'm don't really know how to do it. </p>
  
  <p>How can I resolve this?</p>