select * from (
select year,case when t.month=1 then (select amount from mm s where s.year=t.year and s.month=1) end as m1,
case when t.month=2 then (select amount from mm s where s.year=t.year and s.month=2) end as m2,
case when t.month=3 then (select amount from mm s where s.year=t.year and s.month=3) end as m3,
case when t.month=4 then (select amount from mm s where s.year=t.year and s.month=4) end as m4
from mm t) g
请问想要得到这种格式 需要怎么修改一下
--year m1 m2 m3 m4
--1991 1.1 1.2 1.3 1.4
--1992 2.1 2.2 2.3 2.4
行转列???
兄弟,你起码把mm表的数据展示出来吧,部分也行
最简单的方法是放到字典中 在界面上处理