MySQL Delete 发表于 2020-01-08 更新于 2023-03-01 分类于 MySQL 本文字数: 167 阅读时长 ≈ 1 分钟 别名delete使用别名的时候,要在delete和from间加上删除表的别名,这样才是正确的写法。 12345delete p,r from t_satisfaction_followup_patients p,t_hospital_followup_record r where p.plan_id = '7421aed79a77494d8b2f54c33f62dd2c'AND r.plan_id = '7421aed79a77494d8b2f54c33f62dd2c'AND r.submit_status = 0AND p.id = r.relation_id 多表删除您可以在DELETE语句中指定多个表,以 根据WHERE子句中的条件从一个或多个表中删除行 。不能使用ORDER BY或LIMIT在多台 DELETE。 12DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3WHERE t1.id=t2.id AND t2.id=t3.id; 12DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3WHERE t1.id=t2.id AND t2.id=t3.id; 1DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;