-1

我想使用 WHERE department = 'something' 一次删除 2 个表记录

我试试这个,它没有用:

DELETE FROM departments, categories 
WHERE department.department = 'something' 
AND categories.department = 'something';
4

3 回答 3

0
DELETE FROM departments INNER JOIN categories
    WHERE departments.department = categories.department 
        and department.department = 'something'
于 2012-07-22T13:22:53.333 回答
0

使用此语句解决的问题:

删除部门。*,类别。* 来自部门、类别 WHERE 部门.department = '{$dept_name}' AND categories.department = '{$dept_name}'

于 2012-07-22T13:24:52.730 回答
0
DELETE FROM departments
JOIN categories ON departments.department = categories.department
WHERE department.department = 'something'`
于 2012-07-22T13:26:23.680 回答