当前位置: 代码迷 >> Oracle开发 >> oracle 查询最新数据,该如何处理
  详细解决方案

oracle 查询最新数据,该如何处理

热度:41   发布时间:2016-04-24 06:42:43.0
oracle 查询最新数据
ID    Name    ReportDate
1     a       2014-05-10
2     a       2014-05-12
3     b       2014-02-15
4     b       2014-03-23
5     c       2014-05-20

如上数据   查询出
ID    Name    ReportDate
2     a       2014-05-12
4     b       2014-03-23
5     c       2014-05-20
------解决方案--------------------
select max(id)keep(dense_rank last order by ReportDate),name,max(ReportDate)
from tab
group by name
  相关解决方案