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




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

No comments:
Post a Comment