谢谢sdta版主。
这是 zyg8108 的方法,分享一下:
Select 班级ID, 语文 As 语文平均分, (Select 1 + Count(语文);
From (Select 班级ID, Avg(语文) As 语文 ;
From ChengJiBiao ;
Group By 班级ID) As t1 ;
Where 语文 > T2.语文) As 平均分名次 ;
From (Select 班级ID, Avg(语文) As 语文 ;
From ChengJiBiao ;
Group By 班级ID) As t2 ;
Order By 班级ID && Desc