TOP 1从具有多个实例的每个ID查询 [英] TOP 1 Query from each ID with multiple instances

查看:86
本文介绍了TOP 1从具有多个实例的每个ID查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此查询将返回MS Access中所有行的顶部.

This query will return the top for all rows in MS Access.

SELECT TOP 1 * FROM [table]
ORDER BY table.[Date] DESC;

我需要为每个ID可以返回多个日期的最高日期.

I need to return the top date for each id that can have multiple dates.

ID      DATE
1      01/01/2001
1      01/12/2011
3      01/01/2001
3      01/12/2011

应该只返回最上面的日期.

Should return only the top dates like this.

1      01/12/2011
3      01/12/2011

推荐答案

您将要使用 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆