Inner join - DotNet and DataBase

Follow us on Facebook

SQL Server Mountain View Mountain View Mountain View

Wednesday, 1 August 2018

Inner join





INNER JOIN/JOIN
INNER JOIN is used to retrieve data from two or more tables by comparing common fields.
In INNER JOIN, only the exactly matching rows will be returned.

Syntax:
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name=table2.column_name;

Example:
SELECT E.EmpID,E.EmpName,D.Department FROM tbl_Employees E
INNER JOIN tbl_Dept D ON
E.DeptID = D.DeptID
In the above, the query DeptID is the common field in both tables.

Result:
Inner_join

No comments:

Post a Comment

x

Get Updates On

Discussion updates

Straight Into Your INBOX!

Enter your email address to subscribe to this website and receive notifications of new posts by email.