Mysql Joins,Mysql Using joins

An MYSQL JOIN clause is used to combine rows from two or more tables,

based on a common field

INNER JOIN:

Returns all rows when there is at least one match in BOTH tables


Syntex:

SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name=table2.column_name;


LEFT JOIN:
 


Return all rows from the left table, and the matched rows from the right table

Syntex:

SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name=table2.column_name;


RIGHT JOIN: 
Return all rows from the right table, and the matched rows from the left table

Syntex:

SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name=table2.column_name;

Post a Comment

0 Comments