CREATE PROCEDURE `spLBBattleVotes`(battleID int)BEGINDECLARE totalCalcVotes INT;DECLARE avgCalcRating FLOAT;SELECT count(votedUserID), (sum(rating)/count(votedUserID)) INTO totalCalcVotes, avgCalcRating FROM lb_votes_user WHERE rating>0 GROUP BY battleIDUPDATE lb_battle SET `totalVotes`=totalCalcVotes, `avgRating`=avgCalcRating WHERE id=battleIDENDERROR 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 'SELECT count(votedUserID), (sum(rating)/count(votedUserID)) INTO totalCalcVotes,' at line 5