1 LEFT JOIN: The query results are based on the left table data. If the left table has four data, the right table has three data, the query result is four, and all the data in the left table.
For example:
EMP Table:
Sal table:
Left connection
Select * from EMP left join SAL on EMP. ename = SAL. ename;
Left JOIN, the table EMP is the primary table, so the query results show all the information of the EMP (primary table) and the SAL (schedule) information related to EMP.
2 Right OUTER join: The query results are based on the right table data. If the left table has four data, the right table has three data, the query result is three, and all the data in the right table.
Such as:
Select * from EMP Right Join SAL on EMP. ename = SAL. ename;
Right connection, table Sal is the primary table, so the query results show all the information of the salt (the primary table) and the EMP (schedule) and the information that Sal wants to close.
3 INNER JOIN Link: Two table data prevail. The query results are data for both tables.
SELECT * from EMP Inner Join SAL on EMP. ename = SAL. ename;
Link, which displays information related to a table.
4 Full Join All Links: Query results for all data in two tables
SELECT * from EMP Full Join SAL on EMP. ename = SAL. ename;
Fully connected, displaying all two tables of information.
Description: This article is derived from Shadowyelling's column