一张表
查询结果为
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
m3
from
Tb_Amount group
by years
|