Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个查询,它将返回字段的特定不同值的所有最新条目。示例我的表格有 2 列:ComputerName, date. 我想为它们中的每一个返回所有不同的值ComputerName和最新date的值。
ComputerName
date
如果您只需要date每台计算机的最大值:
table | summarize max(date) by ComputerName
或者,如果您需要date每台计算机最新的全部记录:
table | summarize arg_max(date, *) by ComputerName
相关文档:
使用 MAX 聚合
SELECT ComputerName, MAX(date) FROM table GROUP BY 1