There are probably a few joinsin SQL :
Cross Join
INNER JOIN
Left OUTER JOIN
Right outer join
Full OUTER JOIN
The first is based on the cross join ( Cartesian product), then the inner join, and the rows in the result set of the Cartesian product that do not conform to the join condition are removed.
The left outer join is added to the result set of the inner join and the rows that are not selected in the leftmost table are filled with NUll for each field in the right table section of the row.
The right outer join is added to the result set of the inner join and the rows that are not selected in the left table are filled with NULL padding.
SQL JOIN usage full version
I. meaning of the various joins
There are probably a few joinsin SQL :
Cross Join
INNER JOIN
Left OUTER JOIN
Right outer join
Full OUTER JOIN
The first is based on the cross join ( Cartesian product), then the inner join, and the rows in the result set of the Cartesian product that do not conform to the join condition are removed.
The left outer join is added to the result set of the inner join and the rows that are not selected in the leftmost table are filled with NUll for each field in the right table section of the row.
The right outer join is added to the result set of the inner join and the rows that are not selected in the left table are filled with NULL padding.
outer means "there is no line on the association."
II. old style and standard notation:
1.INNER Join Code as the following:
Select * from a A, b b where A.categoryid = B.categoryid;
Equals:
Select * from a a inner joins b b on a.categoryid = B.categoryid;
2.OUTER Join Code as the following
SELECT * from a a full (left/right) outer join b b to a on a.categoryid = B.categoryid;
Equals::
Select * from a A, b b where A.categoryid *= B.categoryid;
Select * from a A, b b where A.categoryid =* B.categoryid;
Iii. examples
Table A has a (8+4) entries, 8 entries has valid relation with B
Table B has a (77+3) entries, and the entries has valid relation with A.
Then the return amount of joins is:
Cross join:12*80
Inner join:77
Full outer join:77+4+3
Left outer join:77 + 4
Right Outrer join:77 + 3
There are probably a few joins in SQL