日期:2014-05-18 浏览次数:20648 次
select * from (select id,year(begdate) as 时间, fyf from tabl1) as a pivot(sum(fyf) for 时间 in([2009],[2010],[2011],[2012])) as b
id 2009 2010 2011 2012 -----------------------------
------解决方案--------------------
建议楼主去看看 透视、逆透视、分组集