Monday, 2 January 2012

Concatenation of multiple rows of single column as a single data(row)

select Classcode,Classname,
(select subject from ClassSubjectList+',' as 'data()' from ClassSubject for xml path('')) as subject
from Class
where Classcode='LKG'

No comments:

Post a Comment