
麻烦各位大神帮忙看下, 怎么查询能出右面的效果
------解决方案--------------------
试试这个:
select [year],
max(case when [month]=1 then [no] else null end) m1,
max(case when [month]=2 then [no] else null end) m2,
max(case when [month]=3 then [no] else null end) m3
from 表
group by [year]