Kusto/KQL: How to get summary of max values of a single column from multiple tables

Viewed 282

I have a Kusto DB where there are multiple tables describing entities that have shared column names, e.g. they all have an Age column. They are also prefixed with the same string so it's easy to target them all with something like union database("db").PREFIX* (granted a union isn't what I really want here). I want to return a table of the form:

TableName | max(Age)

E.g.

PrefixStudent | 12
PrefixTeacher | 65
PrefixVolunteer | 22

Is there a way to do this without hardcoding the table names?

1 Answers

you can use union withsource=T, for example:

union withsource=T PREFIX*
| summarize max(Age) by T
Related