UNION
Documentation | Blog | Demos | Support
UNION
5 out of 5 stars
1 rating
5 Stars | 100% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
UNION
Combines the members of two or more result sets into a single set.
Syntax
set1 UNION set2
Parameters
set1 | The name of a result set that resulted from the execution of a set-producing command. Set1 and set2 must have the same component structure. |
set2 | The name of a result set that resulted from the execution of a set-producing command. Set1 and set2 must have the same component structure. |
Comments
When used within a FIND command, the set that results from the application of UNION contains all of the records from the specified sets, with duplicates being eliminated.
The sets must have the same component structure.
Example
find Employees (unrelated) WorkFor Managers keep Employees
find current (Employees -> Managers) -> MgrSet
% top level managers
find Employees WorkFor MgrSet keep Employees -> EmpSet
while
find Employees WorkFor EmpSet (Employees -> Managers) -> EmpMgrSet
if $setcount = 0
break
endif
find EmpMgrSet keep Managers -> NewMgrSet
find MgrSet union NewMgrSet -> MgrSet
endwhile
While the preceding program demonstrates the use of UNION, the program can be replaced with the single command shown below.
find Employees WorkFor Managers keep Managers -> MgrSet
See Also
5 out of 5 stars
1 rating
5 Stars | 100% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |