EdgeQL Tutorial

Sets

Subtopics

There are a couple of basic set operators in EdgeQL: UNION and DISTINCT.

UNION merges two multi-sets together. This may result in duplicate entries:

Input
Run
Output
Press the 'Run' button to evaluate the input

DISTINCT gets rid of duplicate entries producing a proper set:

Input
Run
Output
Press the 'Run' button to evaluate the input

Sets cannot be elements of other sets in EdgeQL, so instead the nested syntax is equivalent to a UNION. This is also consistent with the notion that everything is a set, including singleton literal values:

Input
Run
Output
Press the 'Run' button to evaluate the input
Input
Run
Output
Press the 'Run' button to evaluate the input