1. Internal connectionsyntax: "Join, INNER join"function: Two tables connected, plus on match two tables common conditions. Example 1:SELECT tb_o_i.* from tb_o_i INNER JOINTb_o_ig on tb_o_i.c_id=Tb_o_ig.c_id and tb_o_i.C_provider=' 00996 'Example 2:SELECT tb_o_i.* from tb_o_i Join Tb_o_ig on tb_o_i.c_id=Tb_o_ig.c_id WHERE tb_o_i.C_provider=' 00996 '2. Left connectionsyntax: "LEFT JOIN, left OUTER join"function: Refers to the first to take out all the data on the left table, and then add on to the two table Common Criteria matching data. Example 3:SELECT tb_o_i.* from tb_o_i Left JOIN Tb_o_ig on tb_o_i.c_id=Tb_o_ig.c_id WHEREtb_o_i.C_provider=' 00996 'Note: On can only be followed by an association condition, the subsequent conditions are added to where, the following is an error, because the second condition on has no effect.Example 4:SELECT tb_o_i.* from tb_o_i Left JOIN Tb_o_ig on tb_o_i.c_id=Tb_o_ig.c_id and tb_o_i.C_provider=' 00996 '3. Right connectionsyntax: "Right join, right OUTER join"function: Refers to the first to remove all the data from the right table, and then add on to the two table with the common criteria to match the data. Example 5:SELECT tb_o_i.* from tb_o_i Right JOIN Tb_o_ig on tb_o_i.c_id=Tb_o_ig.c_id WHEREtb_o_i.C_provider=' 00996 ' 4. Fully Connectedsyntax: "full join, full OUTER join"effect: A full outer join returns all rows from the left and right tables. When a row does not have a matching row in another table, the selection list column of the other table contains null values, and if there are matching rows between the tables, the entire result set row contains the data values of the base table. Note: The syntax of Outer can be omitted, for example you can use a LEFT join or right join, in essence, Outer Join is inclusive, let it be inclusive!Unlike the exclusivity of the Inner join, the results of the query in the left Outer join will contain all the data from the left table, and the query for right Outer join will contain all of the data from the left table, in reverse.
SQL Server's join query notation