【发布时间】:2019-11-11 21:01:01
【问题描述】:
我是 Kusto 的新手,我正在尝试使用 summarize 进行分组,我可以在其中指定要为我分组的值显示的其他列。
这是我正在尝试做的,在标准 SQL 中提到:
select UserId, LocationId, COUNT(*) as ErrorCount from SampleTable where ResultType != 'Success'
group by UserId
order by ErrorCount desc
我按UserId 分组,但随后我也在分组结果中显示LocationId 的UserId
将以上内容转换为 Kusto,我正在写这个:
SampleTable
| where ResultType != "Success"
| summarize ErrorCount=count() by UserId
| project UserId, LocationId, ErrorCount
| sort by ErrorCount desc
但它不起作用。 Kusto 抱怨它无法确定 LocationId 是否在第 4 行。我使用 Kusto 的 explain 关键字验证了我正在编写正确的 Kusto 查询。那么有什么问题呢?
【问题讨论】: