Alias 语句Alias statement

使用 Alias 语句可为数据库定义别名,之后可在同一查询中使用该别名。Alias statements allow you to define an alias for databases, which can be used later in the same query.

当你要处理多个群集,但希望看起来像是在处理较少的群集时,这很有用。This is useful when you're working with several clusters but want to appear as if you're working on fewer clusters. 必须根据以下语法定义别名,其中 clustername 和 databasename 是现有的有效实体 。The alias must be defined according to the following syntax, where clustername and databasename are existing and valid entities.


alias database['DatabaseAliasName'] = cluster("").database("databasename") alias database['DatabaseAliasName'] = cluster("").database("databasename")

alias database DatabaseAliasName = cluster("").database("databasename") alias database DatabaseAliasName = cluster("").database("databasename")

  • 'DatabaseAliasName' 可以是现有名称,也可以是新名称。'DatabaseAliasName' can be either an existing name or a new name.
  • 映射的 cluster-uri 和映射的 database-name 必须出现在双引号 (") 或单引号 (') 内The mapped cluster-uri and the mapped database-name must appear inside double-quotes(") or single-quotes(')


alias database["wiki"] = cluster("").database("somedatabase");
database("wiki").PageViews | count 
alias database Logs = cluster("").database("otherdatabase");
database("Logs").Traces | count 

Azure Monitor 不支持此功能This capability isn't supported in Azure Monitor