title: Trigger to update all records with same data
body: <p>I have a column named 'Ratio' in my table. Which I want to use to store the value of the ratio of the items with respect to the total value at a specific date.</p>
  <p>The problem I'm facing is that the trigger only changes the ratio of one row (NEW.row) and leaves the values of the rest alone. But when one value changes I want them all to change since it is a ratio.</p>
  <p>This is what I have so far;</p>
  <pre><code>CREATE TABLE `item_table` (
      `id` INT(11) NOT NULL AUTO_INCREMENT,
      `Date` DATE DEFAULT NULL,
      `Name` VARCHAR(20) DEFAULT NULL,
      `Value` DECIMAL(7 , 6 ) DEFAULT NULL,
      `Ratio` DECIMAL(7 , 6 ) DEFAULT NULL,
      PRIMARY KEY (`id`)
  );
  
  
  CREATE 
      TRIGGER  `ins_ratio`
   BEFORE INSERT ON `item_table` FOR EACH ROW 
      SET NEW . `Ratio` = NEW.`Value` / (SELECT 
              SUM(`Value`)
          FROM
              `item_table`
          WHERE
              Date = NEW.Date);
  </code></pre>
  <p>How can I get this done?</p>