代碼如下:
drop table if exists dd;
create table dd (
user_id int ,
class_no int ,
score int
);
insert into dd values (1,1,1), (2,1,1), (3,1,2), (4,2,2);
select class_no ,avg(score)from dd group by class_no order by avg(score);
在MySQL下面測試通過.
《MYSQL數據庫mysql 查詢表中平均分最低的班級》要點:
本文介紹了MYSQL數據庫mysql 查詢表中平均分最低的班級,希望對您有用。如果有疑問,可以聯系我們。
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/4964.html