共用方式為


批次

適用於:✅Microsoft FabricAzure 數據總管Azure 監視器Microsoft Sentinel

只要查詢是以分號 (;) 字元分隔,查詢就可以包含多個表格式表達式語句。 然後,查詢會傳回多個表格式結果。 結果是由表格式表達式語句所產生,並根據查詢文字中的語句順序排序。

注意

例子

本文中的範例會使用 說明叢集中公開可用的數據表,例如 Samples 資料庫中的 StormEvents 數據表。

本文中的範例會使用公開可用的數據表,例如天氣分析中的 StormEvents 數據表,範例數據

下列範例示範如何同時建立多個數據表。

名稱表格式結果

下列查詢會產生兩個表格式結果。 然後,使用者代理程式工具可以使用每個相關聯的適當名稱來顯示這些結果(分別Count of events in FloridaCount of events in Guam)。

StormEvents | where State == "FLORIDA" | count | as ['Count of events in Florida'];
StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']

輸出

共用計算

批處理適用於多個子查詢共用常見計算的案例,例如儀錶板。 如果常見的計算很複雜,請使用 具體化() 函式 並建構查詢,使其只執行一次。

let m = materialize(StormEvents | summarize n=count() by State);
m | where n > 2000;
m | where n < 10

輸出

n
伊利諾伊州 2022
愛荷華州 2337
堪薩斯州 3166
密蘇里州 2016
德克薩斯州 4701