上面那条答案应该是可以的啊,可能是看起来复杂了点吧,我自己试过是没问题的:SELECT t1.sno,t1.cno,Score FROM SC t1 WHERE EXISTS (SELECT COUNT(1)FROM SC WHERE t1.cno= cno AND t1.score<score HAVING COUNT(1)<3)ORDER BY t1.cno,score DESC 另外还有一种类似的写法:SELECT t1.sno...
(select Student.S#,Sname,Sage,Ssex,SC.C#,score,Cname from SC inner join Student on SC.S#=Student.S inner join Course on Course.C#=SC.C#) as t where exists(select count(1) from t as d where C#=d.C# and score < d.score having count(1)<3 )请采纳答案,支持我一下。