sql优化,如何将in换为exists
时间:2021-07-01 10:21:17
帮助过:27人阅读
-- 优化
2 select * from tb_power p
where exists(
3 select power_id
from tb_role_power rp
where exists(
4 select 1 from tb_user_role ur
where userid
=1 and ur.role_id
=rp.role_id
5 )
and p.id
=rp.power_id
6 )
sql优化,如何将in换为exists
标签:sql优化 col 所有权 pow 权限 用户 bsp from color