共用方式為


around()

適用於:✅Microsoft網狀架構Azure 數據✅總管 Azure 監視器✅Microsoft Sentinel

建立值,指出第一個 bool 自變數是否位於中心值周圍的範圍內。

語法

around(,中心,差異)

深入瞭解 語法慣例

參數

姓名 類型​​ 必要 Description
value int、long、real、datetime 或 timespan ✔️ 要與中心比較的值。
center int、long、real、datetime 或 timespan ✔️ 定義為 [(center-delta) 的範圍中心。 (center + delta)]。
delta int、long、real、datetime 或 timespan ✔️ 定義為 [(center-delta) 的範圍差異值。 (center + delta)]。

傳回

true如果值在範圍內,false則傳回值超出範圍。 如果任何自變數為 null,則傳null回 。

範例:篩選特定時間戳的值

下列範例會篩選特定時間戳周圍的數據列。

range dt 
    from datetime(2021-01-01 01:00) 
    to datetime(2021-01-01 02:00) 
    step 1min
| where around(dt, datetime(2021-01-01 01:30), 1min)

輸出

dt
2021-01-01 01:29:00.0000000
2021-01-01 01:30:00.0000000
2021-01-01 01:31:00.0000000