title: Loop through temporary table in trigger
body: <p>I have this trigger that cointains a temporary table. Now I wish to loop through the temporary table and do something on each row. Is there some easy way of doing this? I have googled but everything seems overly complicated for such a simple task.</p>
  
  <pre><code>CREATE TRIGGER myTrigger AFTER UPDATE ON myTable
  FOR EACH ROW
  BEGIN
  IF NEW.col &lt;&gt; OLD.col THEN
      DROP TEMPORARY TABLE IF EXISTS tmpTable;
      CREATE TEMPORARY TABLE IF NOT EXISTS tmpTable AS (my select statement);
      --For each row in tempTable--
          Do something
      --
      DROP TEMPORARY TABLE tmpTable;
  END IF;
  END
  </code></pre>