ITeye博客

oracle 多表删除 同时删除多表中关联数据

conkeyn · 2012-09-19 16:30 · DB/Oracle · 数据库 · Markdown

DELETE from COMIC_ANIMATION_ENTITY en where EXISTS
(select 1 from COMIC_ANIMATIONEPISODE ep where en.ITEM_CONTENT_CODE=ep.content_code and ep.content_type=4);

delete from comic_animation_to_type type1 where exists
(select 1 from comic_animation a where type1.animation_id=a.id and a.content_type=4);

delete from comic_animation_to_classify cl where exists
(select 1 from comic_animation an where cl.animation_id=an.id and an.content_type=4);

delete from comic_animationepisode ep where ep.content_type=4;
delete from comic_animation an where an.content_type=4;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。