开发者社区 问答 正文

优化

已解决

select SId,Sname,avg(score) from student as a  join sc  as b on  a.sid=b.sid group by a.sid having avg(score)>=60

展开
收起
1096548036803731 2019-02-16 20:36:04 529 分享 版权
1 条回答
写回答
取消 提交回答
  • 采纳回答
    select student.SId,sname,ss from student,(
        select SId, AVG(score) as ss from sc  
        GROUP BY SId 
        HAVING AVG(score)> 60
        )r
    where student.sid = r.sid;
    2019-02-16 20:37:11
    赞同 展开评论