1行列转换例子2--行转列select sname,culture,'语文' from studentscoreunionselect sname,math ,'数学' from studentscoreunionselect sname,physics,'物理' from studentscore---列传行select ename 姓名,max(case courses when '语文' then score end) 语文 ,max(case courses when '数学' then score end) 数学 ,max(case courses when '物理' then score end) 物理 from dd group by ename;3这是一个查询累计日产量的,觉得有趣,便也记下来吧 --关键词: over([partition by 字段名] order by 字段名 ) select dateday 日期号, sum(turnout)over(order by dateday) 日产, turnout 累计日产 end 20210311