Right outer join/right join
A right outer join returns all the rows from the right table that are specified in the right outer join clause, not just the rows in which the columns match.
A right join selects all the rows from the table on the right (cows_two
in our sample), and displays the matching rows from the table on the
left (cows_one). It displays an empty row for the table on the left
if the table has no matching value for the table on the right.
SELECT * FROM cows_one RIGHT OUTER JOIN cows_two ON cows_one.cnumber =
cows_two.cnumber;
cnumber | cbreed | cnumber | breeds
----------- +------------+ ---------+---------
2 | Guernsey | 2 | Jersey
3 | Angus | 3 | Brown Swiss
| | 4 | Ayrshire
(3 rows)
The keyword outer is optional.