1

我想做与以下 SQL 查询等效的操作 -

(大致)

SELECT 
    Name,
    application_Version
    Rank() OVER (PARTITION BY application_Version ORDER BY CountOfEventNamePerVersion)
FROM
    customEvents

假设我CountOfCompanyPerVersion很容易得到这个领域。我想使用 AIQL 做同样的事情,但我无法做到这一点。这是我尝试过的一个查询-

customEvents
| summarize count() by name, application_Version
| project name, application_Version, count_
| summarize x = count(count_) by application_Version
| where x = count_

基本上我想获得每个 application_Version 最常见的名称。我怎样才能做到这一点?

4

1 回答 1

2

arg_max应该可以解决问题:

customEvents
| summarize count() by Name, application_Version
| summarize arg_max(count_, Name) by application_Version
| order by application_Version 
| project application_Version, Name=max_count__Name 
于 2018-02-26T09:37:44.240 回答