posts - 165, comments - 198, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

mysql 数据库学习(触发器)

Posted on 2008-01-24 18:26 G_G 阅读(262) 评论(0)  编辑  收藏 所属分类: Database
 引用:http://bbs.mysql.cn/thread-9135-1-2.html
 引用:21. 触发程序

delimiter //
create trigger a_bi
before 
insert on a
for each row Begin
    
if new.s2=0 then
      
if(new.s3=1then
        
insert into b(s2) values(new.s1);
      elseif(new.s3
=2)then
        
insert into c(s2) values(new.s1);
      
end if;
    
end if;
    
end;//
delimiter ;


只有注册用户登录后才能发表评论。


网站导航: