sql让一条数据放不同

select 姓名,课程,成绩 from Table_Bunpivot(成绩 for 课程 in ([语文],[数学],英语)) 临时表
或者
select 姓名,‘语文’ as 课程,语文 as 成绩 from Table_B union allselect 姓名,‘数学’ as 课程,数学 as 成绩 from Table_B union all
select 姓名,‘英语’ as 课程,英语 as 成绩 from Table_Border by 姓名,课程 desc

猜你喜欢

转载自blog.csdn.net/qq_28198893/article/details/82964082