sql语句用法 desc

2024-11-26 19:57:42
推荐回答(2个)
回答1:

select sno, avg(DISTINCT grade) as 平均成绩
from SC
group by sno
where avg(DISTINCT grade)>70
order by avg(grade) desc
在这里用where还是比较好的

回答2:

select * from
(select sno, avg(DISTINCT grade) as 平均成绩
from SC
group by sno
HAVING avg(DISTINCT grade)>70)
order by 平均成绩 desc