使用英语阅读

通过


Table.Keys

语法

 
Table.Keys(table as table) as list

关于

返回指定表的键。

示例 1

获取表的键列表。

使用情况

let
    table = Table.FromRecords({
        [Id = 1, Name = "Hello There"],
        [Id = 2, Name = "Good Bye"]
    }),
    tableWithKeys = Table.AddKey(table, {"Id"}, true),
    keys = Table.Keys(tableWithKeys)
in
    keys

输出

{[Columns = {"Id"}, Primary = true]}