常用sql语句和函数selectt.*,px=rank()over(orderby[平均成绩]desc)from(selectm.Sno[学生编号],m.Sname[学生姓名],isnull(cast(avg(score)asdecimal(18,2)),0)[平均成绩]fromStudentmleftjoinSCnonm.Sno=n.Snogroupbym.Sno,m.Sname)torderbypxselectt.*,px=DENSE_RANK()over(orderby[平均成绩]desc)from(selectm.Sno[学生编号