Distinct

Relational model versus Semantic arrays DML

The Select Distinct … From … statement is used to select unique occurrences of one or more attributes from a table.

single attribute selection

Assume the following SQL Statement:

Select Distinct Town From Appartment

This statement can be applied on our relation model, resulting in the following data:

For a SQL Distinct statement in the GeoDMS a new Domain unit needs to be configured with the Unique function. This function generates a Subitem called Values, containing the unique occurrences of its Argument, in alphabetic order.

GeoDMS configuration (the Appartment domain unit is configured in a src container):

unit<uint32> Town := unique(src/Appartment/Town);

multiple attributes selection

Assume the following SQL Statement:

Select Distinct Town, ZipCode From Appartment

The GeoDMS Unique function does not support multiple arguments. Therefore concatenate the Town and ZipCode attributes, see the example:

unit<uint32> TownZipCode := unique(src/Appartment/Town + '_' + src/Appartment/ZipCode);