Try this...
Create Table #TableName (Sno Int, Company Nvarchar(40), Location Nvarchar(100))
Insert into #TableName
Select 1,'A','Chennai' Union All
Select 2,'A','Pune' Union All
Select 3,'B','Delhi' Union All
Select 4,'A','Bangalore' Union All
Select 5,'B','Hyderabad'
Select Distinct t.Company,STUFF((Select Distinct','+ a.Location
From #TableName a
Where a.Company=t.Company
for Xml Path(''), TYPE
).value('.','VARCHAR(Max)'),1, 1, '')
as Location
From #TableName t
Drop Table #TableName
Output:
Company Location
A Bangalore,Chennai,Pune
B Delhi,Hyderabad