프로그래밍/db

[MSSQL] JOIN 예제

-샤리- 2020. 6. 11. 23:20

INNER JOIN

SELECT A.name, A.age, B.school_name 
FROM A INNER JOIN B ON A.school_no = B.school_no
WHERE A.seq = 10

 

LEFT OUTER JOIN

SELECT A.name, A.age, B.school_name 
FROM A LEFT OUTER JOIN B ON A.school_no = B.school_no
WHERE A.seq = 10

 

RIGHT OUTER JOIN

SELECT A.name, A.age, B.school_name 
FROM A RIGHT OUTER JOIN JOIN B ON A.school_no = B.school_no
WHERE A.seq = 10