SINGLETON function

The SINGLETON function takes a single atomic value and returns a set containing only that value.

The syntax of the SINGLETON function is:
SINGLETON(<atomic-value>)
where atomic-value is an atomic value, such as 50 for an integer set or 'fifty' for a string set. It can also be a single-assign attribute. The resulting set will contain only atomic-value.
Examples of some results are as follows ({ } indicates an empty set):
SINGLETON(NULL) = { }
SINGLETON(1) = { 1 }
SINGLETON('a') = { 'a' }

SINGLETON example

In this example, WineType is a single-assign string attribute and WineID is the primary key of the records:
RETURN results AS
SELECT 
   WineID AS idRec,
   SINGLETON(WineType) AS singleAttr
FROM WineState
WHERE WineID BETWEEN 10 AND 14
ORDER BY idRec
The result of this statement might be:
idRec    singleAttr
----------------------
| 10 | { Bordeaux }  |
| 11 | { Zinfandel } |
| 12 | { Red }       |
| 13 | { Bordeaux }  |
| 14 | { Merlot }    |
----------------------