MySQL 插入前触发 - 截断不正确的 DOUBLE 错误
MySQL trigger before insert - truncated incorrect DOUBLE error
我想将新用户名与字符串连接起来,我有以下触发器:
CREATE DEFINER=`root`@`localhost` TRIGGER `rating_platform`.`admins_BEFORE_INSERT` BEFORE INSERT ON `admins` FOR EACH ROW
BEGIN
SET NEW.username = NEW.username + "test";
END
我收到此错误:
ERROR 1292: 1292: Truncated incorrect DOUBLE value: 'test'
我做错了什么?
使用CONCAT
函数:
SET NEW.username = CONCAT(NEW.username,"test");
我想将新用户名与字符串连接起来,我有以下触发器:
CREATE DEFINER=`root`@`localhost` TRIGGER `rating_platform`.`admins_BEFORE_INSERT` BEFORE INSERT ON `admins` FOR EACH ROW
BEGIN
SET NEW.username = NEW.username + "test";
END
我收到此错误:
ERROR 1292: 1292: Truncated incorrect DOUBLE value: 'test'
我做错了什么?
使用CONCAT
函数:
SET NEW.username = CONCAT(NEW.username,"test");