我想使用 WHERE department = 'something' 一次删除 2 个表记录
我试试这个,它没有用:
DELETE FROM departments, categories
WHERE department.department = 'something'
AND categories.department = 'something';
我想使用 WHERE department = 'something' 一次删除 2 个表记录
我试试这个,它没有用:
DELETE FROM departments, categories
WHERE department.department = 'something'
AND categories.department = 'something';
DELETE FROM departments INNER JOIN categories
WHERE departments.department = categories.department
and department.department = 'something'
使用此语句解决的问题:
删除部门。*,类别。* 来自部门、类别 WHERE 部门.department = '{$dept_name}' AND categories.department = '{$dept_name}'
DELETE FROM departments
JOIN categories ON departments.department = categories.department
WHERE department.department = 'something'`