SELELCT a1, b2 FROM A, B WHERE a3 = b1 AND a2 = 5 AND b3 = 7
SELELCT a1, b2 FROM
(SELECT FROM A WHERE a2 = 5),
(SELECT BROM B WHERE b3 = 7)
WHERE a3 = b1
SELELCT a1, b2 FROM A, B WHERE a3 = b1
SELELCT a1, b2 FROM
(SELECT a1, a3 FROM A),
(SELECT b1, b2 BROM B)
WHERE a3 = b1
SELELCT a2, SUM(a1) FROM A, B WHERE a2 = b1 GROUP BY a2
SELELCT a2, SUM(a1) FROM (SELECT a2, SUM(a1) FROM A GROUP BY a2), B WHERE a2 = b1 GROUP BY a2
- 서브쿼리 결과물에선 b1 에 대한 index 사용 불가
SELECT a1 FROM A WHERE a3 IN (SELECT b1 FROM B WHERE b3 = 4)
- b1 에 대한 index를 사용할 수 있음
SELECT a1 FROM A, B WHERE a3 = b1 AND b3 = 4