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?
5 out of 5 stars

1 rating

5 Stars 100%
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.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

pt_BRPortuguese