LEFT JOIN is used to retrieve data from two or more tables by comparing common fields.
LEFT JOIN and LEFT OUTER JOIN both are the same in functionality.
LEFT JOIN Query returns all rows from LEFT tables and matching rows only from the RIGHT table.
Not matching rows from the RIGHT table are return with the NULL value.
Syntax:
SELECT column_name(s)
FROM table1
LEFT [Outer] JOIN table2
ON table1.column_name=table2.column_name;
FROM table1
LEFT [Outer] JOIN table2
ON table1.column_name=table2.column_name;
Example:
SELECT E.EmpID,E.EmpName,D.Department FROM tbl_Employees E
LEFT JOIN tbl_Dept D ON
E.DeptID = D.DeptID




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

No comments:
Post a Comment