# Databases > SQL Server - Types of Joins in SQL

## Adarsh B

Hi pls can any one tel me and explain types of Joins in SQL??

----------


## debasisdas

Please find the details here.

----------


## samu

Hello, Thank U...........

----------


## krishna420

1. Inner join 2. Outer join 3. Cross join 1. Inner join: inner join is the default type of join, it will producesses the result set, which contains matched rows only. Syntax: select * from table1table2 2. Outer join: outer join produces the results, which contains matched rows and unmatched rows. Here we have three types of joins, 1.left outer join 2.right outer join 3.full outer join left outer join: left outer join producesses the results, which contains all the rows from left table and matched rows from right table. Syntax: select * from table1table2 right outer join: right outer join producesses the resultset, which contains all the rows from right table and matched rows from left table. Syntax:select * from table1table2 full outer join: full outer join producesses the resultset, which contains all the rows from left table and all the rows from right table. Syntax:select * from table1table2 3.cross join: a join without having any condition is known as cross join, in cross join every row in first table is joins with every row in second table. Syntax: select * from table1table2 self join: a join joins withitself is called self join working with self joins we use alias tables.

----------


## mobinsk

We have three types of Joins in sql.
They are
1. Inner join 
2. Outer join 
3. Cross join 

1. Inner join: 
                 Inner join is the default type of join, it will producesses the result set, which contains matched rows only. 

Syntax: select * from table1table2 
Here noneed of specifying innerjoin. Simply we can specify Join also.

Syntax: select * from table1table2 

2. Outer join: 
                  Outer join produces the results, which contains matched rows and unmatched rows. 

Outer join is further classified as  three types.They are 
1.left outer join 
2.right outer join 
3.full outer join.

a.Left outer join: 
                      Left outer join producesses the results, which contains all the rows from left table and matched rows from right table. 

Syntax: select * from table1table2 

b.Right outer join: 
                       Right outer join producesses the resultset, which contains all the rows from right table and matched rows from left table. 

Syntax:select * from table1table2 

c.Full outer join: 
                     Full outer join producesses the resultset, which contains all the rows from left table and all the rows from right table. 

Syntax:select * from table1table2 

3.Cross join: 
                A join without having any condition is known as cross join, in cross join every row in first table is joins with every row in second table. Cross join is nothing but cortizion product.

Syntax: select * from table1table2 

Self join: 
           A join joins withitself is called self join working with self joins we use alias tables.

----------


## mobinsk

We have three types of Joins in sql.
They are
1. Inner join 
2. Outer join 
3. Cross join 

1. Inner join: 
Inner join is the default type of join, it will producesses the result set, which contains matched rows only. 

Syntax: select * from table1  table2 where 
Here noneed of specifying innerjoin. Simply we can specify Join also.

Syntax: select * from table1  table2 where 

2. Outer join: 
Outer join produces the results, which contains matched rows and unmatched rows. 

Outer join is further classified as three types.They are 
1.left outer join 
2.right outer join 
3.full outer join.

a.Left outer join: 
Left outer join producesses the results, which contains all the rows from left table and matched rows from right table. 

Syntax: select * from table1  table2 where 

b.Right outer join: 
Right outer join producesses the resultset, which contains all the rows from right table and matched rows from left table. 

Syntax:select * from table1  table2 where 

c.Full outer join: 
Full outer join producesses the resultset, which contains all the rows from left table and all the rows from right table. 

Syntax:select * from table1  table2 where 

3.Cross join: 
A join without having any condition is known as cross join, in cross join every row in first table is joins with every row in second table. Cross join is nothing but cortizion product.

Syntax: select * from table1table2 

Self join: 
A join joins withitself is called self join working with self joins we use alias tables.

----------

