Kusto KQL相当于mysql中的string_agg

Sea*_*lay 3 mysql azure kql azure-data-explorer

有没有办法在 Kusto KQL 中连接列?

例如,对于MySQL (v8) 中world具有列的某些数据集:name

select group_agg(name) from world;
Run Code Online (Sandbox Code Playgroud)

会导致:

| string_agg                                    |
|-----------------------------------------------|
| Afghanistan,Azerbaijan,Bahrain,Bangladesh,... |
Run Code Online (Sandbox Code Playgroud)

Avn*_*era 7

使用make_set创建唯一值的动态数组,然后可以使用strcat_array获取列表的字符串值。例如:

StormEvents
| take 10
// get array of the distinct values
| summarize make_set(State) 
// get a string value of the array
| extend states = strcat_array(set_State, ", ")
Run Code Online (Sandbox Code Playgroud)

结果: 在此输入图像描述

  • 只是补充一下,如果不需要删除重复项,还有一个“make_list”(对于这个问题的情况可能没有用,但我在处理我确实想提取重复项的情况时遇到了这个答案,所以可能会有所帮助未来的访客) (2认同)