@Delete("DELETE blo,col,com,ima,lik,vid FROM blog blo" +
" LEFT JOIN collect col ON col.blog_id=blo.blog_id " +
" LEFT JOIN comment com ON com.blog_id=blo.blog_id " +
" LEFT JOIN image ima ON ima.blog_id=blo.blog_id " +
" LEFT JOIN mylike lik ON lik.blog_id=blo.blog_id " +
" LEFT JOIN video vid ON vid.blog_id=blo.blog_id " +
"WHERE blo.blog_id = #{blog_id} ")
Integer deleteBlogById(@Param("blog_id") String blog_id);
sql多表关联删除
![](https://img-home.csdnimg.cn/images/20240711042549.png)