今天中国E盟技术频道的编辑将给你们讲述MySQL查询表中平均分最低的班级,通俗易懂,现在就分享给大家,也给大家做个参考,一起跟随中国E盟技术小编过来看看吧。
复制代码 代码如下:
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下面测试通过。更多精彩内容,尽在http://www.sem.org.cn。





