Right Join - DotNet and DataBase

Wednesday, 1 August 2018

Right Join





RIGHT JOIN/RIGHT OUTER JOIN
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;

Example:
SELECT E.EmpID,E.EmpName,D.Department FROM tbl_Employees E
RIGHT JOIN tbl_Dept D ON
E.DeptID = D.DeptID 

Result:
RightJoin

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.