我想创建一个可以执行两个操作的事件,但我不知道如何操作。这是查询:
CREATE EVENT rate ON SCHEDULE EVERY 24 HOUR STARTS '2011-12-01 20:00:00' DO SET @p=1
UPDATE users SET rate = (@p:=@p+1) ORDER BY power DESC
我也尝试在操作之间写 AND,但它仍然写错误。
错误是:
\#1064 - 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 'UPDATE users SET rate = (@p:=@p+1) ORDER BY power DESC' at line 2