mysql获取分组后每组的最大值实例详解
1. 测试数据库表如下:
create table test
(
`id` int not null auto_increment,
`name` varchar(20) not null default '',
`score` int not null default 0,
primary key(`id`)
)engine=InnoDB CHARSET=UTF8;
2. 插入如下数据:
mysql> select * from test;
+----+----------+-------+
| id | name | s
- 1
- 2
- 3
前往页