I have a junction table that holds an employeeID and DepartmentID. Sort of like:
EmpID DeptID
1 200
1 300
1 110
2 300
2 200
I would like to write an SQL statement that would return the following dataset with one record for each Employee ID for display purposes:
EmpID Departments
1 200,300,110
2 300, 200
Can this be done without the use of a Sproc? If so how?
EmpID DeptID
1 200
1 300
1 110
2 300
2 200
I would like to write an SQL statement that would return the following dataset with one record for each Employee ID for display purposes:
EmpID Departments
1 200,300,110
2 300, 200
Can this be done without the use of a Sproc? If so how?