Start here
Left Outer Join vs Right Outer Join in SQL
A left outer join keeps every row from the first table, and a right outer join keeps every row from the second. Examples of both, and when to use each.
Writing SQL
How the join types differ, when to use each and how to chain several joins in one query.
Start here
A left outer join keeps every row from the first table, and a right outer join keeps every row from the second. Examples of both, and when to use each.
Chain one JOIN per extra table, each with its own ON condition. Learn how inner and left joins behave across three tables, with a worked example and output.
Inner join, left join, right join and full outer join are the four main JOIN types in SQL. Here is what each returns, with sample tables and results.
Pick an inner join for matches only, a left join to keep every row from your main table, and a full join to keep unmatched rows from both, with examples.
No join type is faster by default. Speed depends on indexes, table sizes and the query plan, so test your own queries with EXPLAIN before you choose.
Related topics