gpt4 book ai didi

azure - Azure 流分析的嵌套条件

转载 作者:行者123 更新时间:2023-12-02 08:02:30 24 4
gpt4 key购买 nike

我有 2 个问题:

  1. azure Stream Analytics 是否支持使用 CASE 语句的嵌套条件?
  2. 我看到这里提到了两种 CASE 表达式格式 - https://learn.microsoft.com/en-us/stream-analytics-query/case-azure-stream-analytics 。我找到了搜索案例 here 的示例。谁能举出简单 CASE 表达式的例子吗?

最佳答案

示例数据:

[{
"id": "0001",
"type": "donut",
"name": "Cake"
},
{
"id": "0002",
"type": "donut2",
"name": "Cake2"
]

Does azure Stream analytics support nested conditions using the CASE statement ?

根据我的测试,它支持嵌套的情况条件。

SQL:

select jsoninput.id as id, jsoninput.type as type ,
case when
((case when jsoninput.id = '0001' then '0' else '1' end) = '0' ) then '0'
else '1' end as res
from jsoninput

输出:

enter image description here

Can anyone give example for the Simple CASE expression?

SQL:

select jsoninput.id as id, jsoninput.type as type ,
case jsoninput.id when '0001' then 'true' else 'false' end as res
from jsoninput

输出:

enter image description here

关于azure - Azure 流分析的嵌套条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53114778/

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