SQL connections can be divided into internal, external, and cross-joins.
1. Internal connection: Inner Join the query operation lists the data rows that match the join criteria, which uses comparison operators to compare the column values of the concatenated columns.
1.1 SELECT * from Table1 as a, Table2 as B where a.id= b.id
1.2 SELECT * FROM Table1 as a inner joins Table2 as B on a.id = b.ID
External connection
2.1 Left OUTER join (simply put, left table data full display, right mismatch display null)
SELECT * from Table1 as a left join Table2 as B on a.id = b.ID
2.2 Right outer connection (opposite)
SELECT * from Table1 as a right joins Table2 as B on a.id = b.ID
2.3 Full connection (when a row does not have a matching row in another table, the selection list column for the other table contains a null value.) If there are matching rows between the tables, the entire result set row contains the data values of the base table)
SELECT * from Table1 as a full outer join Table2 as B on a.id = b.ID
3. Each row in the left table is combined with all rows in the right table. Cross joins are also called Cartesian product
SELECT * from Table1 as a cross join Table2 as B Order b a.id
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
SQL table Connection Basic syntax