Oracle分组查询后,获取最大值的记录

最近在写个分组查询获取最新时间戳的语句时,发现这样写挺受用的,分享之:sql   select * from test a where a.updatetime=(select max(b.updatetime) from test b where a.type=b.type)   ps:假设a是已经groupby以后的表。code
相关文章
相关标签/搜索