EQL provides a number of row functions for working with sets.
The set row functions can be used anywhere that an arbitrary expression
can be used. For example, they can be used in
SELECT clauses,
WHERE clauses,
ORDER BY clauses, and so on.
CARDINALITY function
The CARDINALITY row function takes a set and returns the number of elements in that set.
COUNTDISTINCTMEMBERS function
The COUNTDISTINCTMEMBERS function counts the number of elements in a set that has the union of all its values.
DIFFERENCE function
The DIFFERENCE row function takes two sets of the same data type and returns a set containing all of the elements of the first set that do not appear in the second set.
INTERSECTION function
The INTERSECTION row function takes two sets of the same data type and returns a set that is the intersection of both input sets.
IS_EMPTY and IS_NOT_EMPTY functions
The IS_EMPTY and IS_NOT_EMPTY functions determine whether a set is or is not empty. The IS EMPTY and IS NOT EMPTY functions provide alternative syntaxes for these functions.
IS_MEMBER_OF function
The IS_MEMBER_OF row function takes an atomic value and a set, and returns a Boolean indicating whether the atomic value occurs in the set.
SINGLETON function
The SINGLETON function takes a single atomic value and returns a set containing only that value.
SUBSET function
The SUBSET row function takes two sets of the same data type and returns a Boolean indicating whether the first set is a subset of the second set.
TRUNCATE_SET function
The TRUNCATE_SET row function takes a set and an integer, and returns a copy of the set with no more than the specified number of elements in it.
UNION function
The UNION row function takes two sets of the same data type and returns a set that is the union of both input sets.