gpt4 book ai didi

azure-data-explorer - 如何在 Kusto 查询中匹配多个值

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

假设我有一张这样的 table

data = (Name:string, Team:string)[
"Toma","Team1",
"Tomb","Team2",
"Tomc","Team3",
"Tomd","Team2",
]

我想在 team1 和 team2 中找到成员。我现在编写查询的方式是使用

data
| where Team == "Team1" or Team == "Team2"

它给了我想要的。有没有办法在列表中做到这一点,这样我就不需要写 Team == "XXX"

let Teams ={ "Team1" "Team2"} 
data
| where Team (magic here) in Teams

这样我就可以修改 Teams 变量并获得我想要的结果。

最佳答案

是的,你可以简单地写你想要的:

let Teams = dynamic(["Team1","Team2"]);
data
| where Team in (Teams)

关于azure-data-explorer - 如何在 Kusto 查询中匹配多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71232171/

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