What is a right outer join?
A right outer join is a join that keeps every row from the second (right-hand) table, whether or not it matched anything in the first (left-hand) table. Unmatched left-hand columns come back as NULL.
It is the exact mirror of a left outer join: A RIGHT JOIN B returns the same rows as B LEFT JOIN A. Which means the interesting question isn’t what it does, but when writing it this way is clearer than flipping the table order.
A worked example
You have a tickets table and an agents table, and you want a workload view across your whole support team — including the two agents who happened to close nothing last week.
SELECT
agents.name,
COUNT(tickets.id) AS tickets_closed
FROM tickets
RIGHT OUTER JOIN agents ON tickets.assignee_id = agents.id
WHERE tickets.closed_at >= '2026-07-14' OR tickets.id IS NULL
GROUP BY agents.name
Before: 12 agents, and a tickets table with rows for only 10 of them.
After: 12 rows. The two idle agents show up with tickets_closed = 0 instead of dropping out of the report — which is the whole point, since a workload dashboard that hides the people doing nothing is worse than useless.
When the right join actually reads better
Most analysts rewrite right joins as left joins, and that’s usually good advice: SQL reads top to bottom, so starting from the table you want to preserve keeps the query’s intent visible in the first line.
Right joins earn their keep in two situations:
- You’re extending an existing query. There’s already a
FROM tickets JOIN ...chain three joins deep, and you need to bolt on a table whose rows must all survive. AppendingRIGHT JOIN agentsis a one-line change; restructuring the wholeFROMclause to lead withagentsis not. - Generated or layered SQL. When a model, CTE, or tool builds the left-hand side for you, you don’t get to choose what comes first.
Watch the filter trap
The OR tickets.id IS NULL in the example above isn’t decoration. Any WHERE condition on a left-hand column silently discards the preserved rows, because NULL >= '2026-07-14' is not true. The cleaner fix is to move the date condition into the ON clause, where it restricts which rows are eligible to match without evicting the unmatched ones.
This bites harder on right joins than left joins, purely because the preserved table is the one further from your eye.
Right outer joins in Metabase
The query builder offers right outer join as one of the four join types in the join-type picker, alongside left outer, inner, and full outer. Support varies by database — a few engines that Metabase connects to don’t implement every join type, and the picker will tell you when an option isn’t available for that data source.
Key article
Related terms
Further reading
Put it to work
- First response time — Metric
- Support overview dashboard — Dashboard
- Support analytics — Overview