I have a table like below in SQL Server 2008
location LOB UnitName
---------- --------- -------------------
Chennai Health UnitB
Mumbai Health UnitB
Pune Health UnitA,UnitB
Chennai Motor UnitB
Mumbai Motor UnitB
Pune Motor UnitB,UnitC
Trivandum Motor UnitC
And I am expecting the result like below..
Location Health Motor
--------- -------- --------
Chennai UnitB UnitB
Mumbai UnitB UnitB
Pune UnitA,UnitB UnitB,UnitC
Trivandum UnitC
I need a query to display like this. Can anyone help me to achieve this??