sql 联表DELETE



DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id;


DELETE FROM t1, t2 USING t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id;


二、使用left join

DELETE d FROM  ruis_drawing as d
left join ruis_drawing_group as g on g.id = d.group_id
left join ruis_drawing_group_type as t on t.id = g.type_id
where t.id in (4,7,9,13);

上面的例子,只删除 ruis_drawing表里面的数据,如果也要删除其他表,只需要在 from 前加上要删除的表的别称。





已有 10 条评论

  1. EBTBnGLvY

    10 About 22 to 25 of orally administered amisulpride is excreted in urine, mostly as the unchanged parent drug prix acheter levitra

  2. abadway

    Chen QM, et al best place to buy cialis online Figure 2a c summarize the results for each procedural step, with focus on the results of staged palliative approach

  3. abadway

    Affiliation Division of Epidemiology, Vanderbilt University Medical Center, Vanderbilt University, Nashville, Tennessee, United States of America finasteride costco

  4. abadway

    secobarbital will decrease the level or effect of guanfacine by affecting hepatic intestinal enzyme CYP3A4 metabolism cialis without a doctor's prescription Marnewick JL, Rautenbach F, Venter I, et al

  5. ingenly

    how to buy cialis Thread puffy nipples while on d bol

  6. Diusymn

    cialis super active Eating the right amount of protein and calories is important for healing, fighting infection, and having enough energy

  7. _不息