题目: 同一年同一个月份只有一条,但是一年有多个月 分析: a1对应的smonth里面的 1。年、月为列。

题目: 同一年同一个月份只有一条,但是一年有多个月 分析: a1对应的smonth里面的 1。年、月为列。 正解: 1、用case when select ayear, sum(case when smonth=1 then samont else 0) as a1, sum(case when smonth=2 then samont else 0) as a2, sum(case when s
相关文章
相关标签/搜索