select
UnitId,
stuff((select ', ' + convert(varchar, WorkOrderNumber)
from tblWorkOrders t2 where t1.UnitId = t2.UnitId
for xml path('')),
1,2,'') WorkOrderNumbers
from tblWorkOrders t1
group by UnitId
select
UnitId,
stuff((select ', ' + convert(varchar, WorkOrderNumber)
from tblWorkOrders t2 where t1.UnitId = t2.UnitId
for xml path('')),
1,2,'') WorkOrderNumbers
from tblWorkOrders t1
group by UnitId