Reputation: 3832
I need a query which will return all latest entries for specific distinct value of a fields.
Example I have table with with 2 columns: ComputerName
, date
.
I want to return all distinct values for ComputerName
and latest date
for each of them.
Upvotes: 2
Views: 7125
Reputation: 25895
If you only need the maximum date
per computer:
table
| summarize max(date) by ComputerName
alternatively, if you need the entire records with latest date
per computer:
table
| summarize arg_max(date, *) by ComputerName
Relevant docs:
Upvotes: 6