Home > Database > Mysql Tutorial > mysql 查询表中平均分最低的班级_MySQL

mysql 查询表中平均分最低的班级_MySQL

WBOY
Release: 2016-06-01 13:19:25
Original
1309 people have browsed it

bitsCN.com
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下面测试通过。bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template