logo-header

 
 

syntax

  • unique(a)

definition

unique(a) results in a new domain unit with the unique occurences of attribute a. The unique function can be used to configure a SQL Select Distinct or Group By Statement.

description

The unique function generates a subitem, named Values. This item contains the ascending sorted, unique occurences of attribute a. The Values subitem can be used in a lookup (in case the attribute a contains index numbers) or in a rjoin function, to relate attributes to the new domain, see the example.

applies to

Attribute a with Numeric, Point, uint2, uint4, bool or string value type

since version

5.15

example

unit<uint32> Region := unique(City/RegionCode)
{
attribute<string> name := rjoin(Values, City/RegionCode, City/RegionName);
}
City/RegionCode City/RegionName
100 Noord Holland
200 Zuid Holland
300 Utrecht
200 Zuid Holland
400 Noord Brabant
null null
400 null
domain City, nr of rows = 7 

Region/Values Region/name
100 Noord Holland
200 Zuid Holland
300 Utrecht
400 Noord Brabant
null null
domain Region, nr of rows = 5

OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904