1) 서브쿼리가 옵티마이저에 의해 조인으로 풀립니다.
2) 조인으로 풀린 서브쿼리 집합은 후행처리가 됩니다. (OUTER와 INNER가 있을 때 INNER로 처리된다는 뜻)
3) OUTER테이블에서 INNER테이블로 조인을 시도했을 때 하나의 로우가 조인에 성공하면 진행을 멈추고 OUTER테이블의 다음 로우를 계속 처리해가는 방식입니다.
select company, group_name
from idol_group t1
where exists (select '1'
from idol_member t2
where t1.group_name = t2.group_name
and t2.birthday like '1997%');
select * from 런닝맨 t1 where exists (select 'X'from 무한도전 t2 where t1.name = t2.name);
select * from 런닝맨 t1 where not exists (select 1 from 무한도전 t2 where t1.name = t2.name);
select 이름
,ntile(5) over (order by 국어 desc) 국어등급
,국어
,ntile(5) over (order by 수학 desc) 수학등급
,수학
,ntile(5) over (order by 영어 desc) 영어등급
,영어
from exam_score;
select t1.no, max(t1.title), t1.count_dt, max(t1.download_cnt), sum(t2.download_cnt) "누적 값"
from ssak3 t2, ssak3 t2
where t1.no = t2.no
and t1.count_dt >= count_dt
group by t1.no, t1.count_dt
order by t1.no, t1.count_dt
select no, title, count_dt, download_cnt
,sum(download_cnt) over (partition by no order by count_dt rows between unbounded preceding and current row) "누적 값"
,sum(download_cnt) over (partition by no order by count_dt rows between current row and unbounded following) "거꾸로 누적값"
from ssak3
출처: 정미나쌤 유투브 강의