SQL table connection basic syntax and SQL connection basic syntax
SQL connections can be divided into internal connections, external connections, and cross connections.
1. Inner join: the inner join query operation lists the data rows that match the connection condition. It uses the comparison operator to compare the column values of the connected columns.
1.1 select * from Table1 as a, Table2 as B where a. id = B. id
1.2 select * from Table1 as a inner join Table2 as B on a. id = B. id
2.3 Full join (when a row does not match a row in another table, the selection list column of the other table contains a null value. If there are matched rows between tables, the entire result set row contains the data value of the base table)
Select * from Table1 as a full outer join Table2 as B on a. id = B. id
3. Combine each row in the left table with all rows in the right table. Cross join is also called Cartesian product.
Select * from Table1 as a cross join Table2 as B order B a. id
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.