What is Join and Explain different types of Join
Joins are used in a queries to explain how different table are related .Joins also let you select data from a table depending upon data from another table
Types of Join
1.Simple Join(Equi-Join,Non equi Join)
2.Self Join
3.Outer Join
1.Equi-Join
A Join based on equalities, is called an equi-Join,the equi-Join combines rows that have equivalent values for the specied column
Example-Select odate,deldate,itemcode,qty_order from ordermaster,orderdetails where ordermaster.orderno=orderdetails.orderno
2.Non Equi-Join
A Non -EquiJoin specifies the relationship between column belonging to different table by making use of the relational operator(>,<,<=,>=<>) other then =
3.Self-Join
Joining of a Table to itself is known as self join,The join is performed by mirroring the table using where clause
4.Outer-Join
An Outer join returns all the rows return by simple join as well as those row from one table that do not match any row from other table.This can not be done with a simple join.The symbol(+) represents outer join
Example:
Select a.orderno,vencode from ordermaster a, orderdetails where a.orderno=orderdetails.orderno(+)
No Comments Yet!!