多行数据合并
SELECT B.resultNo,resultList as result FROM ( SELECT resultNo,(SELECT CONVERT(nvarchar, questionnaireNo)+CONVERT(nvarchar, highestQuestionNo) FROM ResultAnalyze WHERE resultNo=A.resultNo ORDER BY questionnaireNo FOR XML PATH('')) AS resultList FROM ResultAnalyze A GROUP BY resultNo ) B