1
我想创建一个触发器,删除删除其所有文章内容后的文章。我得到一个1064 error at line 5
。删除触发器中第5行的PL/SQL 1064错误
这里是PL/SQL我已经写:
delimiter |
create trigger `cleanup_article` after delete on `article_content`
for each row
begin
declare x int;
set x = select count(*) as x from `article_content` where id = old.id;
if x = 0 then
delete from `article` where id=old.id;
end if;
end |
delimiter ;