我尝试从表中删除一行,但是当我尝试时出现错误:#1241 - Operand should contain 1 column(s)
我的查询是:DELETE FROM Posts WHERE idPosts = 6;
我不明白为什么我不能删除帖子(idPosts = 6 的帖子存在)
我的桌子上也有一个触发器:
CREATE TRIGGER post_delete_update_lastPost_topic after delete on Posts for each row
BEGIN
UPDATE Topics SET lastPost = (SELECT *
FROM Posts
WHERE idTopic = old.idTopic
ORDER BY datePosts DESC
LIMIT 1)
WHERE idTopics = old.idTopic;
END $$