日期:2014-05-17 浏览次数:20793 次
select s.sname , c.cname , t.grade from s , c , sc t where s.sno = t.sno and t.cno = c.cno and t.grade = (select max(grade) from sc where cno = t.sno) select s.sname , c.cname , t.grade from s , c , sc t where s.sno = t.sno and t.cno = c.cno and not exists (select 1 from sc where cno = t.sno and grade > t.grade)
------解决方案--------------------
select a.sname , b.cname , c.grade from s a , c b, sc c where a.sno = c.sno and b.cno = c.cno and not exists (select 1 from sc c where cno = c.sno and grade > c.grade)