发布网友 发布时间:2022-04-22 20:42
共1个回答
热心网友 时间:2022-04-10 03:04
select
Name,
sum(decode(Subject,'语文',上半年成绩,0)) 语文,
sum(decode(Subject,'数学',上半年成绩,0)) 数学,
sum(decode(Subject,'英语',上半年成绩,0)) 英语,
sum(decode(Subject,'语文',下半年成绩,0)) 语文,
sum(decode(Subject,'数学',下半年成绩,0)) 数学,
sum(decode(Subject,'英语',下半年成绩,0)) 英语
from score
group by Name;追问非常感谢,但是如果课程名称(个数、名称)不确定的情况下怎么处理呢?谢谢!