How MSSQL concatenates query results into strings

select SizeID,Matid,SizeCaption from mmfsize(nolock) where matid='000309' order by SizeID

select (select SizeCaption+',' from mmfsize(nolock) b where a.Matid=b.Matid order by b.SizeID for xml path('')) as SizeCaption
from MMFSize(nolock) a where a.Matid='000309' group by Matid

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324989947&siteId=291194637