单表删除
DELETE t from table2 t where t.id = "ff3a59cd-c109-4422-bfb6-6b0e33357943";
mysql中多表关联删除两种写法
一:
DELETE t from table t
INNER JOIN table2 t2 on t.id =t2.id
where t2.name="张三";
二:
DELETE from t ,t2 USING table t,table2 t2
where t.id =t2.id and t2.name="张三";
mysql中using的用法为:
using()用于两张表的join查询,要求using()指定的列在两个表中均存在,并使用之用于join的条件。
select a.*, b.* from a left join b using(colA);
-- 等同于
select a.*, b.* from a left join b on a.colA = b.colA;
参考原文:http://database.51cto.com/art/201005/202216.htm
http://www.jb51.net/article/64936.htm