Link to home
Start Free TrialLog in
Avatar of soujanya nomula
soujanya nomula

asked on

question about regrouping the rows

hi all,

I have a similar issue posted here, but not exactly the same.

I have a table
emp_dept
(emp_id numeric,
dept_id numeric,
department char(3) )

employees
(emp_id numeric,
 emp_name varchar(100)
)

1: 1 employee can belong to 2 different departments
2: I want the output like
emp id, emp_name, (list of all departments the emp_id belongs to )--separated by comma)

this is for displaying, I know we can use a temp table etc to do this, but was looking for any better approach.
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial