一个sql查询的问题

2025-05-21 15:40:17
推荐回答(3个)
回答(1):

课程名字必须是确定的
select t.name,
max((case
when t.source = 'chinese' then
t.mark
end)) chinese,
max((case
when t.source = 'math' then
t.mark
end)) math
from ss t
group by t.name

回答(2):

select name,course from A where 条件

回答(3):

本人水平有限,个人认为这不能一句话就可以,要两句,再把各个结果使用变量,再相加.