一张表


|
1
2
3
4
5 |
--行转列select
years,(select
amount from
Tb_Amount as
A where month=1 and
A.years=Tb_Amount.years)as
m1,(select
amount from
Tb_Amount as
A where month=2 and
A.years=Tb_Amount.years)as
m2,(select
amount from
Tb_Amount as
A where month=3 and
A.years=Tb_Amount.years)as
m3from
Tb_Amount group
by years |
原文:http://www.cnblogs.com/Warmsunshine/p/3618701.html