【发布时间】:2021-12-02 18:20:40
【问题描述】:
我在从 JSON 中获取不同的值并按字母顺序排序时遇到了一些麻烦。
存储在动态类型中的 JSON,列名为 data。
JSON:
"Data": [
{
"Code": "CC",
},
{
"Code": "AA",
},
{
"Code": "BB",
}
]
我尝试了以下方法:
Table
| mv-expand data
| distinct tostring(data.Code)
//get the distincts
Table
| mv-expand data
| extend Codes= tostring(data.Code)
| distinct tostring(data.Code)
| sort by Codes asc
//Try to sort
我希望输出是这样的:
AA
BB
CC
我能够获得所有不同的代码,但排序不起作用或未应用。 我错过了什么吗?
【问题讨论】:
标签: azure-data-explorer kql distinct-values