SQL JOINS

단단한어린이·2022년 6월 8일
0

SQL/NoSQL

목록 보기
1/1
post-thumbnail


The INNER JOIN keyword selects records that have matching values in both tables.

SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;

The LEFT JOIN keyword returns all records from the left table, and the matching records from the right table. The result is 0 records from the right side, if there is no match.

SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;

The FULL OUTER JOIN keyword returns all records when there is a match in left (table1) or right (table2) table records.

SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;
profile
Footprints in Coding

0개의 댓글