gpt4 book ai didi

azure-data-explorer - 将不同行的数据组合成一个字符串

转载 作者:行者123 更新时间:2023-12-05 01:14:57 25 4
gpt4 key购买 nike

我正在从数据表的单个列中获取数据。我需要将它组合成一个由逗号或任何定界符分隔的字符串。

最终结果应该是一个字符串而不是表格数据。

let words = datatable(word:string, code:string) [
"apple","A",
"orange","B",
"grapes","C"
];
words | project word;

我需要将结果组合成一个带有分隔符的字符串。

结果应该是:"apple,orange,grapes"

最佳答案

尝试将 strcat_array()summarize make_list() 结合使用,如下所示:

let words = datatable(word:string, code:string) [
"apple","A",
"orange","B",
"grapes","C"
];
words
| summarize result = strcat_array(make_list(word), ",")

这将返回具有单个字符串列的单个表,其值为:apple,orange,grapes

关于azure-data-explorer - 将不同行的数据组合成一个字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57472695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com