How to write for this scenario

  • I ahve 3 tables employee(EmpID,name),department(DeptID,DeptName) and employeedepartment(EmpID,

    DeptID).

    I need to show all department names and their employee names.Example

    Production James

    Production Kapil

    Commerce NULL

    Finance Jack

    thks

  • Select

    D.DeptName, E.Name

    From

    department D

    Left

    Outer Join employeedepartment ED

    ON

    ED.DeptID = D.DeptID

    Left

    Outer Join employee E

    On

    E.EmpID = ED.EmpID

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply