所以我试图在mySQL中做一个触发器,看起来像:
在桌子上:喜欢,事件:插入后
IF NEW.
action` = 1那么
INSERT IGNORE INTO matches
(user_id, user_id_friend)
(SELECT user_id_from, user_id_to
FROM likes
WHERE user_id_from = NEW.user_id_to AND user_id_to = NEW.user_id_from AND `action` = 1);
IF (SELECT user_id_from, user_id_to
FROM likes
WHERE user_id_from = NEW.user_id_to AND user_id_to = NEW.user_id_from
AND `action` = 1) IS NOT NULL
THEN
INSERT IGNORE INTO matches
(user_id, user_id_friend)
VALUES
(NEW.user_id_from, NEW.user_id_to);
END IF;
END IF`
语法应该是正确的,因为heidi SQL(我正在使用的软件)允许我保存它,但是当我尝试使用action = 1插入一些东西时,它显示我:MySQL错误1241:操作数应该包含1列 我做错了什么?