多行数据合并

 

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
查询代码

posted @ 2014-03-02 16:29  Alf7  阅读(102)  评论(0编辑  收藏  举报