查询所有同学的学生编号、学生姓名、选课总数、所有课程的总成绩

总数:count()          总分:sum()           排序:ORDER BY        分组:group by

命令:SELECT DISTINCT a.Sid,a.Sname,a.Sage,a.Ssex,b.Cid,b.score from ex_xueshengbiao_95 a 

left join (select  Sid,count(1) as 'Cid',sum(score) as 'score' from ex_chengjibiao_95 group by sid) b 

on a.Sid=b.Sid ORDER BY a.Sid

mysql查询(六)

 

 

相关文章:

  • 2021-09-16
  • 2021-04-19
  • 2021-12-02
  • 2021-06-03
  • 2021-11-12
  • 2021-08-26
  • 2021-08-21
  • 2022-12-23
猜你喜欢
  • 2021-09-03
  • 2021-11-28
  • 2021-04-12
  • 2022-12-23
  • 2021-08-08
  • 2021-04-13
  • 2021-12-05
相关资源
相似解决方案