sql语句:
DELIMITER $$ CREATE TRIGGER `Activation_code` BEFORE UPDATE
ON `user_users` FOR EACH ROW
BEGIN
IF OLD.activation_code_time < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 15 MINUTE)) THEN SET NEW.activation_code = SELECT(ROUND((RAND() * (999999-100000))+100000)), NEW.activation_code_time = SELECT(UNIX_TIMESTAMP());
END
$$ DELIMITER ;
# 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT(ROUND((RAND() * (999999-100000))+100000)), NEW.activation_code_time = SEL' at line 4
谁能告诉我哪里出错了吗。我该怎么解决呢?
1条答案
按热度按时间bnl4lu3b1#
选择需要置于括号内,所有语句都需要以结尾;你需要结束如果
如果激活码时间可能为空,您应该为其编码。