Category Archives: Join Tutorials

MySQL: InnoDB transactions, a practical example

Only the MySQL storage engine InnoDB supports transactions. A major benefit of transactions is that it’s possible to roll back changes until a transaction is committed. This example show you how to write multi-statement transaction, how to perform a rollback in case … Continue reading

Posted in Join Tutorials | Leave a comment

MySQL DELETE Join example

A very useful helper in your join toolbox can be a delete join. Even though it’s not a special join type but a join used within DELETE statements, it’s still worth mentioning. However, from time to time when I want … Continue reading

Posted in Join Tutorials | Tagged , , , | Leave a comment

UPDATE joins in MySQL

When you want to update rows that are stored in MySQL tables you use update statements. Usually the table you’re updating has to be defined and in case you want to update only certain rows a condition for the update … Continue reading

Posted in Join Tutorials | Tagged , , | 4 Comments

MySQL INNER JOIN Tutorial: the comma operator

Here you find information about writing inner joins with the comma operator. It’s the most basic way to combine (join) two tables. There is an alternative syntax that can be used, because in MySQL you can write inner joins in two … Continue reading

Posted in Join Tutorials | Tagged , , , , | 5 Comments

MySQL NATURAL JOIN Tutorial & Examples

This tutorial explains how you can use NATURAL JOINs and what a natural join is actually. Included are syntax details and example statements. Generally speaking, the keyword NATURAL can be treated as a join condition which is added implicitly. If used, it … Continue reading

Posted in Join Tutorials | Tagged , , , , | 4 Comments

MySQL STRAIGHT JOIN Tutorial & Examples

This tutorial shows you how to write straight joins in MySQL and when an it makes sense to do so. Included are a general description, syntax examples and a comparison of straight and inner joins.

Posted in Join Tutorials | Tagged , , | Leave a comment

MySQL RIGHT OUTER JOIN Tutorial & Examples

Here you find information about writing RIGHT JOINs (also referred to as RIGHT OUTER JOINs). This introduction into right joins includes a detailed description, syntax information and right outer join example statements. The Venn diagram on the left represents a result set … Continue reading

Posted in Join Tutorials | Tagged , , , , | 1 Comment

MySQL LEFT OUTER JOIN Tutorial & Examples

Here you find information about writing LEFT JOINs (also referred to as LEFT OUTER JOINs). This introduction into left joins includes a description, syntax information and example statements that use left outer joins. The Venn diagram on the left represents a result set … Continue reading

Posted in Join Tutorials | Tagged , , , , | 3 Comments

MySQL OUTER JOIN Tutorial & Examples

Here you find information about OUTER JOINs in MySQL statements. This tutorial is a general introduction. Syntax details and example statements are split into a LEFT OUTER JOIN tutorial and RIGHT OUTER JOIN tutorial because these are specific outer joins. 

Posted in Join Tutorials | Tagged , , | 8 Comments

MySQL INNER JOIN Tutorial & Examples

This tutorial shows you how to write ANSI-Style inner joins with the INNER JOIN keywords. Included are a general description, some syntax examples and a comparison between inner and cross joins. Note: In MySQL the join keywords JOIN and CROSS JOIN are … Continue reading

Posted in Join Tutorials | Tagged , , , | 48 Comments