select Id from Advertising t where exists ( select 1 from adgroup g where t.adgroup = id and exists( select id from adseries where same='sd' and g.adseries=id ) )TRY
select Id from Advertising t where exists ( select 1 from adgroup g where t.adgroup = id and exists( select id from adseries where same='sd' and g.adseries=id ) )
from Advertising t
where exists (
select 1 from adgroup g
where t.adgroup = id
and exists(
select id from adseries
where same='sd'
and g.adseries=id
)
)TRY
from Advertising t
where exists (
select 1 from adgroup g
where t.adgroup = id
and exists(
select id from adseries
where same='sd'
and g.adseries=id
)
)
也不高 SQL查询会自动优化 其实都差不多 具体可以看执行计划