Skip to content

Select ... From ... Where ...

mtbeek32 edited this page Jan 9, 2023 · 14 revisions

The Select ... From ... Where ... DML statement is used to select records from a table/view that meet the condition defined in the Where Clause.

In the GeoDMS first a new domain unit needs to be configured with the e.g. the subset function, resulting in a subitem called Nr_OrgEntity with as values unit the index numbers of the original domain. This Nr_OrgEntity attribute can be used to get the data from the original domain for the new subset domain, using the lookup function (see examples).

single attribute selection

Assume the following SQL Statement:

Select Street, Number, Zipcode, Town From Appartment Where Town = 'BTown'`

This statement can be applied on our Relational model versus Semantic arrays, resulting in the following data:

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

unit<uint32> singleAttSelection := subset(src/Appartment/Town == 'BTown')
{
   attribute<string> Street  := src/Appartment/Street[Nr_OrgEntity];
   attribute<uint32> Number  := src/Appartment/Number[Nr_OrgEntity];
   attribute<string> ZipCode := src/Appartment/ZipCode[Nr_OrgEntity];
   attribute<string> Town    := src/Appartment/Town[Nr_OrgEntity];
}

## multiple attributes selection

Assume the following SQL Statement:

**Select** Street, Number, Zipcode, Town **From** Appartment **Where** ZipCode = 'AA6681' **And** Number = 3

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

[[images/Relation_select_from_where2.png]]

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

unit<uint32> multipleAttSelection := subset(src/Appartment/ZipCode == 'AA6681' && src/Appartment/Number == 3)
{
   attribute<string> Street  := src/Appartment/Street[Nr_OrgEntity];
   attribute<uint32> Number  := src/Appartment/Number[Nr_OrgEntity];
   attribute<string> ZipCode := src/Appartment/ZipCode[Nr_OrgEntity];
   attribute<string> Town    := src/Appartment/Town[Nr_OrgEntity];
}
Clone this wiki locally