What is join and types of mysql join

By September 3, 2018My SQL

MySQL JOINS are used to retrieve data from multiple tables.

There are different types of MySQL joins:

  1. MySQL INNER JOIN
  2. MySQL LEFT OUTER JOIN
  3. MySQL RIGHT OUTER JOIN

INNER JOIN
It is the most common type of join. MySQL INNER JOINS return all rows from multiple tables where the join condition is met.

Syntax
The syntax for the INNER JOIN in MySQL is:

 

LEFT OUTER JOIN
Another type of join is called a MySQL LEFT OUTER JOIN. This type of join returns all rows from the LEFT-hand table specified in the ON condition and only those rows from the other table where the joined fields are equal (join condition is met).

Syntax
The syntax for the LEFT OUTER JOIN in MySQL is:

RIGHT OUTER JOIN
Another type of join is called a MySQL RIGHT OUTER JOIN. This type of join returns all rows from the RIGHT-hand table specified in the ON condition and only those rows from the other table where the joined fields are equal (join condition is met).

Syntax
The syntax for the RIGHT OUTER JOIN in MySQL is:

 

Leave a Reply