- 今天才发现一个很简单的语句,不用在写四条删除语句,删除多张表中同一字段的数据下面分为A,B,C,D四张表同一字段为user_id
- 查询字段为user_id
-
DELETE A,B,C,D
fromA
LEFT JOIN B
ON A.user_id =B.user_id
LEFT JOIN C
ON A.user_id =C.user_id
LEFT JOIN D
ON A.user_id =D.user_id
WHERE A.user_id= 0001
- 筛选条件删除某张表某个字段
- UPDATE `表名` SET `字段名`=‘‘ WHERE `id`=‘id‘