The MULTISET UNION operator combines two collections to form a third collection. The signature is:
Where coll_1 and coll_2 specify the names of the collections to combine.
Include the ALL keyword to specify to represent duplicate elements (elements that are present in both coll_1 and coll_2) in the result, once for each time they're present in the original collections. This behavior is the default.
Include the DISTINCT or UNIQUE keyword to include duplicate elements in the result only once. There is no difference between the DISTINCT and UNIQUE keywords.
This example uses the MULTISET UNION operator to combine collection_1 and collection_2 into a third collection, collection_3:
The resulting collection includes one entry for each element in collection_1 and collection_2. If you use the DISTINCT keyword, the results are as follows:
The resulting collection includes only those members with distinct values.
In this example, the MULTISET UNION DISTINCT operator removes duplicate entries that are stored in the same collection: