Option Distinct clauseOfficial Content

Deprecated since: GeneXus X Evolution 3
Replaced by: Unique Clause

It is used to specify uniqueness of records retrieved.

Syntax

In For Each command (X Evolution 2) and Xfor Each command:

Option Distinct

In Data Provider object:

GroupName [Distinct]

Description

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.

Examples

Suppose that we have defined the following For Each command:

For Each
       Defined by InvoiceDate
       option Distinct
       &CustomerName = CustomerName
EndFor

which is equivalent to this Data Provider:

Customers
{
      Customer [Distinct]
      Defined by InvoiceDate
           {
                   CustomerName
           }
}

The result is a list of different Customer Names.

Note

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

Scope

Commands For Each command (X Evolution 2), Xfor Each command
Objects Data Provider object
   

See also

For Each command (X Evolution 2)
Xfor Each command
Option Distinct clause