A join is a way of searching for something across tables by using shared values to match up the tables. The simplest form is:
SELECT * FROM table1,table2 WHERE table1.id=table2.id;
This yields the complete contents of whichever rows in the two tables share ID numbers. In MySQL, more specific and extensive types of joins exist, including LEFT or RIGHT joins, STRAIGHT or CROSS joins, INNER and OUTER joins, and SELF join.
Joins are very handy and time saving. Using joins MySQL also allows to delete and update records from multi tables in one go.
Table Joins Related FAQs
|