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;
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.




SQL Server
C#.Net
ASP.Net
ADO.Net
jQuery

No comments:
Post a Comment