运维网's Archiver
论坛
›
SQL Server
› sql获取分组后取某字段最大一条记录
ningleesherry
发表于 2018-10-19 11:04:23
sql获取分组后取某字段最大一条记录
select a.* from test a,
(select type,max(typeindex) typeindex from test group by type) b
where a.type = b.type and a.typeindex = b.typeindex order by a.type
页:
[1]
查看完整版本:
sql获取分组后取某字段最大一条记录