当前位置: 代码迷 >> Sql Server >> 请教一个SQL查询语句的有关问题
  详细解决方案

请教一个SQL查询语句的有关问题

热度:48   发布时间:2016-04-24 18:31:52.0
请问一个SQL查询语句的问题



麻烦各位大神帮忙看下, 怎么查询能出右面的效果
------解决方案--------------------
试试这个:
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]
  相关解决方案