一张成绩表,学生编号,课程,成绩 课程有五门:英语,我想查询后这样展示.张三 40 45 45 45 45请教SQL如何写select s.stuname,c1.totalscore,c2.totalscore,c3.totalscore,c4.totalscore,c5.totalscorefrom student s full join ((((
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/06 16:19:03
![一张成绩表,学生编号,课程,成绩 课程有五门:英语,我想查询后这样展示.张三 40 45 45 45 45请教SQL如何写select s.stuname,c1.totalscore,c2.totalscore,c3.totalscore,c4.totalscore,c5.totalscorefrom student s full join ((((](/uploads/image/z/10790904-48-4.jpg?t=%E4%B8%80%E5%BC%A0%E6%88%90%E7%BB%A9%E8%A1%A8%2C%E5%AD%A6%E7%94%9F%E7%BC%96%E5%8F%B7%2C%E8%AF%BE%E7%A8%8B%2C%E6%88%90%E7%BB%A9+%E8%AF%BE%E7%A8%8B%E6%9C%89%E4%BA%94%E9%97%A8%EF%BC%9A%E8%8B%B1%E8%AF%AD%2C%E6%88%91%E6%83%B3%E6%9F%A5%E8%AF%A2%E5%90%8E%E8%BF%99%E6%A0%B7%E5%B1%95%E7%A4%BA.%E5%BC%A0%E4%B8%89+40+45+45+45+45%E8%AF%B7%E6%95%99SQL%E5%A6%82%E4%BD%95%E5%86%99select+s.stuname%2Cc1.totalscore%2Cc2.totalscore%2Cc3.totalscore%2Cc4.totalscore%2Cc5.totalscorefrom+student+s+full+join+%28%28%28%28)
一张成绩表,学生编号,课程,成绩 课程有五门:英语,我想查询后这样展示.张三 40 45 45 45 45请教SQL如何写select s.stuname,c1.totalscore,c2.totalscore,c3.totalscore,c4.totalscore,c5.totalscorefrom student s full join ((((
一张成绩表,学生编号,课程,成绩 课程有五门:英语,
我想查询后这样展示.
张三 40 45 45 45 45
请教SQL如何写
select
s.stuname,c1.totalscore,c2.totalscore,c3.totalscore,
c4.totalscore,c5.totalscore
from
student s full join
((((
chengji c1 left join chengji c2
on c1.topless=0 and c2.topless=1 and c1.stuid=c2.stuid)
left join chengji c3
on c3.topless=2 and c1.stuid=c3.stuid)
left join chengji c4
on c4.topless=3 and c1.stuid=c4.stuid)
left join chengji c5
on c5.topless=4 and c1.stuid=c5.stuid)
on s.stuid=c1.stuid where s.stuid=102
这是我的sql 语句 但是总是有错误 .
没有分数时,仍能查询出值.
一张成绩表,学生编号,课程,成绩 课程有五门:英语,我想查询后这样展示.张三 40 45 45 45 45请教SQL如何写select s.stuname,c1.totalscore,c2.totalscore,c3.totalscore,c4.totalscore,c5.totalscorefrom student s full join ((((
select s.name,
sum(case topless when 0 then totalscore else 0 end)数学,
sum(case topless when 1 then totalscore else 0 end)语文,
sum(case topless when 2 then totalscore else 0 end)英语,
sum(case topless when 3 then totalscore else 0 end)政治,
sum(case topless when 4 then totalscore else 0 end)历史
from student s left join chengji c on s.stuid=c.stuid
group by s.name,s.stuid