Monday, 6 August 2012

To bring the row data in one column

SELECT top 1  
       STUFF((SELECT ',' + b.Coldisp from tempd b Where a.CenterName=B.CenterName FOR XML PATH(''), TYPE ).value('.','varchar(max)') ,1,1, '') AS StudyName  
FROM tempd a  
    GROUP BY  CenterName,Coldata,Coldisp

No comments:

Post a Comment