我是 Kusto/KQL 的新手,但對 T-SQL 有經驗。我正在嘗試獲取例外串列,按型別對它們進行分組,添加一個計數,并按該計數降序排序。在 SQL 中,它將是:
SELECT Type, COUNT(Type)
FROM exceptions
GROUP BY Type
ORDER BY COUNT(Type) Desc
除了那種,我什么都管。
exceptions
| summarize count() by type
我無法弄清楚如何按聚合排序。我試過了| sort by count() desc, | sort by count() by type desc, | as c | sort by c desc,| extend c = summarize count() by type | sort by c desc
uj5u.com熱心網友回復:
count()聚合的默認列名稱是count_,因此:
exceptions
| summarize count() by type
| sort by count_ desc
或者,明確命名列:
exceptions
| summarize CountExceptions = count() by type
| sort by CountExceptions desc
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/381468.html
