Table.Contains
Table.Contains(table as table, row as record, optional equationCriteria as any) as logical
指示指定的记录 row
是否显示为 table
中的一行。
可以指定一个可选参数 equationCriteria
,以控制表各行之间的比较。
示例:
确定表是否包含行。
使用情况:
Table.Contains(Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]}), [Name="Bob"])
输出:
true
示例:
确定表是否包含行。
使用情况:
Table.Contains(Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]}), [Name="Ted"])
输出:
false
示例:
确定表是否包含只比较列 [Name] 的行。
使用情况:
Table.Contains(Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]}), [CustomerID=4, Name="Bob"], "Name")
输出:
true