Select s.FirstName, glTitle.LookupItem Title
from ClientStaff cs
left outer join Staff s on s.Id = cs.StaffId
left outer join StaffTitle st on st.StaffId = s.Id
left outer join GeneralLookup glTitle on glTitle.Id = st.glTitleId
It returns these rows:
As you can see, the first column has all same rows because one employee can have multiple titles.
How can I merge all of the titles for each employee into a comma separated value so that there is only one row per employee?