需要批量根据多字段(字段中可能存有不同值)组合删除时,可使用如下方式:
DELETE
FROM
TableA
WHERE CONCAT (`type`, `name`) IN
(SELECT
*
FROM
(SELECT
CONCAT (a.type, a.name)
FROM
TableA a
JOIN TableB b
ON a.`b_id` = b.`id`
WHERE b.`name` <> 'XX'
AND a.`authority` <> 'XXX')) t);