首页 > 其他 > 详细

Grouping by Multiple Columns to Single Column as A String

时间:2014-08-21 21:00:04      阅读:308      评论:0      收藏:0      [点我收藏+]

 

SELECT t.PROB_ID, STUFF(
(SELECT ‘,‘ + s.NOTES
FROM gpcomp1.GPPROBNOTES s
WHERE s.PROB_ID = t.PROB_ID
FOR XML PATH(‘‘)),1,1,‘‘) AS NOTES
FROM gpcomp1.GPPROBNOTES AS t
GROUP BY t.PROB_ID

Grouping by Multiple Columns to Single Column as A String,布布扣,bubuko.com

Grouping by Multiple Columns to Single Column as A String

原文:http://www.cnblogs.com/hellotech/p/3927954.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!