当前位置: 首页 > 工具软件 > delete > 使用案例 >

【MySQL】DELETE LEFT JOIN

盖翰池
2023-12-01
DELETE u 
FROM sys_user u 
LEFT JOIN sys_dept d ON u.dept_id=d.dept_id 
WHERE d.dept_id=102 and u.user_id!=1;
DELETE ur 
FROM sys_user_role ur 
LEFT JOIN sys_user u ON ur.user_id=u.user_id
WHERE u.user_id is null;
 类似资料: