MYSQL 同时删除多个表(注意非T-SQL)

1 . 删除一个表中的数据
delete from department where name = ' Asset Management ' ;

2 . 删除两个表中的数据
delete employee, employeeSkills
from employee, employeeSkills, department
where employee.employeeID = employeeSkills.employeeID
and employee.departmentID = department.departmentID
and department.name = ' Finance ' ;

3 . 删除两个表中的数据,用using语法
delete from employee, employeeSkills
using employee, employeeSkills, department
where employee.employeeID = employeeSkills.employeeID
and employee.departmentID = department.departmentID
and department.name = ' Finance ' ;

你可能感兴趣的:(MYSQL 同时删除多个表(注意非T-SQL))