求一条sql
有一张表test(sid,sco,score)学号,课程号,成绩
现在要查询每门课程的平均成绩并降序排列
要是平均成绩相等的,则按照学号的升序排列
create table test(
sid int,
sco int,
score int,
)
go
insert into test values(1,1,90)
insert into test values(1,2,90)
insert into test values(1,3,90)
insert into test values(2,1,80)
insert into test values(2,1,80)
insert into test values(3,2,80)
go