相关子查询

找出每个学生 超过他选修课程平均成绩的课程号?

select sno,cno

from sc x

where grade >=(

  select avg(grade)

  from sc y

  where y.sno = x.sno

);

将x.sno传入 内层

执行内层 得到外层

重复...

原文地址:https://www.cnblogs.com/lnas01/p/5131716.html