Table.MatchesAllRows
语法
Table.MatchesAllRows(table as table, condition as function) as logical
关于
指示 table
中的所有行是否与给定的 condition
匹配。 如果所有行均匹配,则返回 true
;否则返回 false
。
示例 1
确定列 [a] 中的所有行值是否在表中。
使用情况
Table.MatchesAllRows( Table.FromRecords({ [a = 2, b = 4], [a = 6, b = 8] }), each Number.Mod([a], 2) = 0)
输出
true
示例 2
查找在表 ({ [a = 1, b = 2], [a = 3, b = 4] })
中是否所有行值均为 [a = 1, b = 2]。
使用情况
Table.MatchesAllRows( Table.FromRecords({ [a = 1, b = 2], [a = -3, b = 4] }), each _ = [a = 1, b = 2])
输出
false