大家好,我是小新,我来为大家解答以上问题。deletesql语句怎么写,deletesql很多人还不知道,现在让我们一起来看看吧!
1、
1、create trigger delete_A
2、on 表A for delete as
3、if(select count(*) from deleted)>0 delete from 表B where coname = (select coname from deleted)
4、注意看他的提示, 最后的 where coname=(select coname from deleted) 这个的子查询返回的是多个值,所以子查询中加入限制条件,比如 select coname from deleted where id=0 这样才行!
本文到此讲解完毕了,希望对大家有帮助。