blog

Home / DeveloperSection / Blogs / Inner Join in Sql Server

Inner Join in Sql Server

Amit Singh3555 28-Apr-2011

“INNER JOIN retrieves all the records from the left table and all the records from the right table.”

 It is similar to intersect operator but basic difference it display the duplicate records. So we used the distinct keyword if we do not find the duplicate record.

Example:
ANSI Style:
 select a.Stu_ID,a.Stu_Name from tbl_SchoolRecord a 
inner join tbl_StudentRecord b
on a.Stu_ID =b.Stu_ID where a.AdmissionDate>='2010-07-20'

Theta style:
select a.Stu_ID,a.Stu_Name from tbl_SchoolRecord a, tbl_StudentRecord b
where a.Stu_ID =b.Stu_ID and a.AdmissionDate>='2010-07-20'


Updated 18-Sep-2014

Leave Comment

Comments

Liked By