2013-05-25 126 views
-2
delimiter/
create trigger nuovoattore 
after insert on attori 
for each row 
when (1970 > (select year(AnnoNascita) 
       from attori 
       where cod_attore=new.cod_attore)) 
begin 
delete from attori 
where cod_attore=new.cod_attore; 
end;/ 
+0

我的老师说什么时候在mysql下载支持downvoto他没有我xD – javierZanetti

回答

1

没有WHEN条款。尝试:

delimiter/
create trigger nuovoattore 
after insert on attori 
for each row 
begin 
    if 1970 > (select year(AnnoNascita) 
       from attori 
       where cod_attore=new.cod_attore) 
    then 
     delete from attori 
     where cod_attore=new.cod_attore; 
    end if; 
end;/