mysql 触发器在触发后执行两条语句 5
我想实现的是createtriggeronblogafterdeleteforeachrowbegin1deletefromcommentwherecomment.blo...
我想实现的是create trigger on blog after delete for each row begin
1 delete from comment where comment.blogid = old.blogi
2 delete from reply where ... 展开
1 delete from comment where comment.blogid = old.blogi
2 delete from reply where ... 展开
2013-05-02
展开全部
DELIMITER //
CREATE TRIGGER tr_del_blog
after DELETE ON blog
FOR EACH ROW
BEGIN
delete from comment where comment.blogid = old.blogi;
delete from reply where reply.blogid = old.blogi;
END;
//
DELIMITER ;
这个效果?
CREATE TRIGGER tr_del_blog
after DELETE ON blog
FOR EACH ROW
BEGIN
delete from comment where comment.blogid = old.blogi;
delete from reply where reply.blogid = old.blogi;
END;
//
DELIMITER ;
这个效果?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-05-02
展开全部
在业务逻辑层多写个逻辑,分开来执行不是就可以了,封装也就可以二个都是实现了
。
。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
然后呢?说清楚啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询