oracle数据库 delete join使用

用left join写


delete from users_branch LEFT JOIN users ON users_branch.users_branch_id =users.user_id IN(
SELECT user_id FROM users where
role_channel IN ('TSM','KAM' ,'MAM') 
and role_desc IN ('BIS','BFS')
);



等同于下面的sql

普通方法比较慢sql语句为


delete from users_branch where user_id in (
SELECT user_id FROM users where
role_channel IN ('TSM','KAM' ,'MAM') 
and role_desc IN ('BIS','BFS')
)
;

猜你喜欢

转载自blog.csdn.net/qq_40646143/article/details/80885438