UNION

UNION

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

UNION

UNION

Combines the members of two or more result sets into a single set.

Syntax

set1 UNION set2

Parameters

set1The name of a result set that resulted from the execution of a set-producing command.
Set1 and set2 must have the same component structure.
set2The 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

INTERSECT

MINUS

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish