Tag Archives: join

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

Joins in MySQL 5: #1054 – Unknown column ‘…’ in ‘on clause’

If you used to write MySQL joins for MySQL versions < 5.0 or upgrade your server from MySQL 4 to MySQL >= 5.0 you maybe run into a problem when you execute the following query: SELECT * FROM mytable1, mytable2 … Continue reading

Posted in Join Hints | Tagged , , , , | 3 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 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