"delete d,r,p from (select "1")tab left join doctor d on d.id=1 left join registration r on d.id=r.doctor_id left join posts p on d.id=p.doctor_id;" 这条SQL语句的含义是:从名为tab的表中删除doctor(简称d)、registration(简称r)和posts(简称p)三张表的匹配记录。在删除前,使用LEFT JOIN连接doctor表的id字段和值为1的记录,再使用LEFT JOIN连接registration表的doctor_id字段和doctor表的id字段,最后使用LEFT JOIN连接posts表的doctor_id字段和doctor表的id字段。

SQL语句解释:从tab表删除doctor、registration和posts匹配记录

原文地址: https://www.cveoy.top/t/topic/qcaj 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录