Open AlfieriChou opened 1 year ago
subquery查询可以优化成临时表关联
select
*
from
a_table
where
b in (
select
b
from
d_table
where
k = '11111'
group by
b
)
2.优化后方案
select
*
from
a_table
left join (
select
b
from
d_table
where
k = '11111'
group by
b
) as t_table on t_table.b = a_table.b
参考文章:https://cloud.tencent.com/developer/beta/article/1705504