What is the difference between
INNER JOINandOUTER JOIN?What do
LEFT JOIN,RIGHT JOINandFULL JOINmean?
The translation of the question " Difference between INNER and OUTER joins " @cdv .
What is the difference between INNER JOIN and OUTER JOIN ?
What do LEFT JOIN , RIGHT JOIN and FULL JOIN mean?
The translation of the question " Difference between INNER and OUTER joins " @cdv .
You can also use this scheme to understand the joining of tables:
Translation of the answer “Difference between INNER and OUTER joins” @Teoman Shipahi
Suppose you want to join in columns without duplicates, which is quite common:
Internal junction A and B: A intersects B, i.e. inner part of the Venn diagram intersection.
External connection A and B: A connects to B, i.e. the outer part of the compound in the Venn diagram.
Examples
Suppose you have two tables. Each consists of one column, with the following values:
AB - - 1 3 2 4 3 5 4 6 Please note that (1,2) are unique to A, (3,4) are common elements, and (5,6) are unique to B.
Internal connection
An inner join using one of the equivalent queries results in the intersection of two tables, that is, two rows common to each of them.
select * from a INNER JOIN b on aa = bb; select a.*, b.* from a, b where aa = bb; a | b --+-- 3 | 3 4 | 4 Left outer join
The result of the left outer join is all rows of table A plus all rows of table B matching the rows of table A.
select * from a LEFT OUTER JOIN b on aa = bb; select a.*, b.* from a, b where aa = bb(+); a | b --+----- 1 | null 2 | null 3 | 3 4 | 4 Right outer join
The result of the right outer join is all the rows in table B plus all the rows in table A that match the rows in table B.
select * from a RIGHT OUTER JOIN b on aa = bb; select a.*,b.* from a,b where aa(+) = bb; a | b -----+---- 3 | 3 4 | 4 null | 5 null | 6 Full external connection
The result of a full outer join is the join of tables A and B, i.e. all rows A and all rows B. If any element of table A has no match in table B, this part B is empty and vice versa.
select * from a FULL OUTER JOIN b on aa = bb; a | b -----+----- 1 | null 2 | null 3 | 3 4 | 4 null | 6 null | 5 Translation of the answer “ Difference between INNER and OUTER joins ” @Mark Harrison .
LEFT OUTER JOIN the same as the LEFT JOIN ? According to the examples it is. But is it really not reflected in the answer. - jekabySource: https://ru.stackoverflow.com/questions/544067/
All Articles