现有6张表存在关联关系,要删除主表则其他5张表关联数据也要一块删掉(单条sql多id批量删除)
delete
t1,t2,t3,t4,t5,t6
FROM
rmd_v AS t1
LEFT JOIN rmd_v1 AS t2 ON t1.uuid = t2.rvuuid
LEFT JOIN rmd_v2 AS t3 ON t1.uuid = t3.rvuuid
LEFT JOIN rmd_v3 AS t4 ON t1.uuid = t4.rvuuid
LEFT JOIN rmd_v4 AS t5 ON t1.uuid = t5.rvuuid
LEFT JOIN rmd_v5 AS t6 ON t1.uuid = t6.rvuuid
WHERE
t1.uuid in ('aaaab','aaaac')