3,491
社区成员
发帖
与我相关
我的任务
分享
select a.name b.*
from a, b
where a.id = b.id
where b.mtime < to_date('20050501', 'yyyy-mm-dd')
group by a.name
--0.1s内出结果
select *
from (select a.name b.*
from a, b
where a.id = b.id
where b.mtime < to_date('20050501', 'yyyy-mm-dd')
group by a.name)
-- 出不来结果 (不是慢,a表300w,b表900w)
select *
from (select /*+ driving_site(a) +driving_site(b)*/ a.name b.*
from a, b
where a.id = b.id
where b.mtime < to_date('20050501', 'yyyy-mm-dd')
group by a.name)
select * from(
select *
from (select /*+ driving_site(a) +driving_site(b)*/ a.name b.*
from a, b
where a.id = b.id
where b.mtime < to_date('20050501', 'yyyy-mm-dd')
group by a.name)) t_main left join t_task
on t_task.name=t_main.name