Reputation: 19896
I have a table with company_name
and RegistrationId
column.
How to write a query so that I can do group by company_name
but concatenate all values of RegistrationId
into a string column (say AllIDs
) with comma like 123,456,789
?
Upvotes: 2
Views: 2579
Reputation: 3017
This can be expressed as:
T | summarize AllIds=make_list(RegistrationId) by company_name
You can use make_set() function to create unique set (without repetitions of ids).
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/makelist-aggfunction https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/makeset-aggfunction
If you need later to format a string from array - use strcat_array() function:
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/strcat-arrayfunction
Upvotes: 3