Sunday, May 3, 2015

SQL INNER Join or EQUI Join

This is a simple JOIN in which the result is based on matched data as per the equality condition specified in the query.
Inner Join Syntax is,
SELECT column-name-list
from table-name1 
INNER JOIN 
table-name2
WHERE table-name1.column-name = table-name2.column-name;

Example of Inner JOIN

The class table,
IDNAME
1abhi
2adam
3alex
4anu
The class_info table,
IDAddress
1DELHI
2MUMBAI
3CHENNAI
Inner JOIN query will be,
SELECT * from class, class_info where class.id = class_info.id;
The result table will look like,
IDNAMEIDAddress
1abhi1DELHI
2adam2MUMBAI
3alex3CHENNAI

No comments:

Post a Comment