本文介绍了SQL 查询以查找最近的一组记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我有共享 IdString
的记录历史记录(每次更新的多条记录都具有完全相同的日期时间).
I have a history of records (multiple records per update all with the exact same datetime) that share an IdString
.
我想要一个查询来确定这些记录中的哪些是最近更新组的一部分.
I want a query to determine which of these records are part of the most recent update group.
此查询将向我显示一个具有最新更新日期的记录,但是对于每个分区,我需要具有该最大日期的所有记录..>
This query will show me one of the records having the most recent update date, but for each partition, I need all the records with that max date.
有人可以帮我找出合适的查询吗?
Would someone please help me figure out an appropriate query?
示例
推荐答案
试试这个 -
这篇关于SQL 查询以查找最近的一组记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!