I have table as follows
C Common Code 337080.00 15 Jan 2014 14 Jun 2017 Ananth Krishnan ee
C Common Code 337080.00 15 Jan 2014 14 Jun 2017 Balaji Srinivasan ee
C Common Code 337080.00 15 Jan 2014 14 Jun 2017 Deepa Venkitesh ee
C Common Code 337080.00 15 Jan 2014 14 Jun 2017 Shanti Bhattacharya ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Bijoy Krishna Das ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Manivasakan R ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Ananth Krishnan ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Balaji Srinivasan ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Deepa Venkitesh ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Harishankar Ramachandran ee
C Common code 500000.00 04 Nov 2010 03 Nov 2012 Shanti Bhattacharya ee
i need to be display as below
C Common Code 337080.00 15 Jan 2014 14 Jun 2017 Ananth Krishnan EE, Balaji Srinivasan ee, Deepa ee ,Venkitesh ee,Shanti Bhattacharya ee
I have used below query but its not supporting in PHP to generate PDF file because i have used XML in the query do you have any other idea to bring this without XML
select a.projecttype as Projecttype,a.projecttitle as projecttitle,a.projectvalue as projectvalue,
CONVERT(VARCHAR(11),a.startdate,106) as startdate,
CONVERT(VARCHAR(11),a.closuredate,106) as closuredate,
STUFF(( select ',' + b.coinvestigatorname + ' ' + b.departmentcode from iitmicsr..coinvestigatordetails b
where a.projectnumber = b.projectnumber FOR XML PATH('')), 1, 1, '') as coinvestigatorname
from iitmicsr..projectdetails a where a.EmployeeId='008074' and a.projecttype in( 'C','S')
order by a.Projecttype,a.StartDate desc