日期:2014-05-18 浏览次数:20627 次
SELECT MIN(A),MIN(B),SUM(C)...MIN(Z) FROM 表 group by N
select N,stuff((select ','+ltrim(A) from tb where N = t.N for xml path('')),1,1,'') as A, stuff((select ','+ltrim(A) from tb where N = t.N for xml path('')),1,1,'') as B from tb t group by N
------解决方案--------------------
SELECT A,...,Z FROM ( select ROW_NUMBER()OVER(PARTITION BY N ORDER BY GETDATE()),A,B,C,...,Z FROM 表) A