Tutorials Hut

  • SQL Testing




  • SQL -Right Outer Join or Right Join
    with Example

    The RIGHT JOIN /RIGHT OUTER returns all records from the Right table  and the matched records from the Left  table

    A (+) = B

    If no matching rows found in the Left table, NULL are used.

    SQL-Right Outer Join

    Syntax:

    SELECT select_List FROM table1 
    RIGHT JOIN table2 
    ON table1.column_name = table2.column_name;

    Example:

    Consider Employee table having below records.

    Employee_Table1

    Consider Department table having below records.

    DepartmentTable2

    List Employees that doesn’t belong to any department

    Select  e1.EmployeeID ,e1.Employee_FirstName ,e1.Employee_LastName ,e1.City , d.departmentID , d.departmentName 
    from Employee e1 RIGHT JOIN Department d on e1.departmentID=d.departmentID   
    WHERE d.departmentName IS NULL
    SQL right Outer Join



  • SQL Testing














  • Leave a Reply

    Your email address will not be published. Required fields are marked *