日期:2014-05-20 浏览次数:20753 次
select
year,
sum(if(M=1, mount,0)) AS M1,
sum(if(M=2, mount,0)) AS M2,
sum(if(M=3, mount,0)) AS M3,
sum(if(M=4, mount,0)) AS M4,
sum(if(M=5, mount,0)) AS M5,
sum(if(M=6, mount,0)) AS M6,
sum(if(M=7, mount,0)) AS M7,
sum(if(M=8, mount,0)) AS M8,
sum(if(M=9, mount,0)) AS M9,
sum(if(M=10, mount,0)) AS M10,
sum(if(M=11, mount,0)) AS M11,
sum(if(M=12, mount,0)) AS M12
from tb
group by year