Following different type of join table.
1)Inner join
2)Left join
3)Right join
4) Self join
5)Full join
6) Cross join
1) Inner Join :
Inner join in display content of similar in both table. It is not provide rest content which are not similar.
Query:
SELECT col_name(s)
FROM table1
INNER JOIN table2 ON table1.col_name = table2.col_name;
2) Left Join :
In left join display whole data of left table and similar of right table.
Query:
SELECT col_name(s)
FROM table1
LEFT JOIN table2 ON table1.col_name = table2.col_name;
3) Right Join :
In right join display whole data of left table and similar of right table.
Query:
SELECT col_name(s)
FROM table1
RIGHT JOIN table2 ON table1.col_name = table2.col_name;
4) Self Join :
A self JOIN is a regular join, but the table is joined with itself.
Query:
SELECT col_name(s)
FROM table1 T1, table1 T2
WHERE condition;
5) Full Outer Join :
Full outer join keyword return all records when there is a match in either left table or right table records.
Query:
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2 ON table1.column_name = table2.column_name;
6) Cross Join :
Cross join produced result of number of raw in table1 multiply number of raw in table2.
Query:
SELECT *
FROM table1
Cross join table2;


0 coment�rios: