title: Mysql event schedule creation SQL error
body: <p>I'm trying to build a scheduled query but something is triggering an error, and it's not clear what's wrong. Event scheduling is a bit new to me but I have plenty others working, so there's some piece of information I'm missing:</p>
  
  <pre><code>DELIMITER //
  CREATE EVENT gen_firstJoins
      ON SCHEDULE EVERY 1 HOUR
      ON COMPLETION PRESERVE
      DO BEGIN
          CREATE TEMPORARY TABLE tmp_joins SELECT username, MIN(player_join) AS player_join FROM joins GROUP BY username ORDER BY player_join ASC ;
          TRUNCATE joins_first;
          INSERT INTO joins_first (username, player_join) SELECT username, player_join FROM tmp_joins GROUP BY username ORDER BY player_join;
      END//  
  DELIMITER ;
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ame, MIN(player_join) AS player_join FROM joins GROUP BY username ORDER BY playe' at line 6</p>
  </blockquote>