select tt.organization_id, left(list,len(list)-1) from (
select t.organization_id,(
select cast(party_id as varchar) + ','
from hrs_employee for xml path('')
) as list
from hrs_employee t group by t.organization_id
) tt
1 0,0,1,1,8000001000002,8000001000003
99 0,0,1,1,8000001000002,8000001000003