This is not the latest version of this document; to access the latest version, click here.
Official Content

Deprecated: Since GeneXus X Evolution 3. Replaced by Unique Clause.

It is used to specify uniqueness of records retrieved.


In For Each command and Xfor Each command:

Option Distinct

In Data Provider object:

GroupName [Distinct]


This clause allows the For each command and Data Provider object to only return records where the set of values of the attributes referred to is unique.

The attributes that are included in the distinct clause are those referenced in the for each command, including: the attributes in the Where, Defined By and the attributes needed to navigate the extended table.


Suppose that we have defined the following For Each command:

For Each
       Defined by InvoiceDate
       option Distinct
       &CustomerName = CustomerName

which is equivalent to this Data Provider:

      Customer [Distinct]
      Defined by InvoiceDate

The result is a list of different Customer Names.


In For Each and XFor Each commands this clause can only be specified immediately after a For Each, Where, or  Defined by command.


See also

For Each command
Xfor Each command
Option Distinct clause


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant