dotConnect for MySQL Documentation
Devart.Common Namespace / SelectStatement Class / Distinct Property
Example

In This Topic
    Distinct Property
    In This Topic
    Gets or sets whether statement should request unique rows only.
    Syntax
    'Declaration
     
    Public Property Distinct As Boolean
    public bool Distinct {get; set;}

    Property Value

    true, if the result set should contain unique rows only; otherwise, false.
    Example
    The following example demonstrates how to use the Distinct property.
    MySqlSelectStatement stmt = new MySqlSelectStatement();
    stmt.Columns.Add(new SelectColumn("JOB"));
    stmt.Tables.Add(new SelectTable("emp"));
    
    stmt.Distinct = true;
    
    //select distinct JOB from emp
    string queryText = stmt.ToString();
    Dim stmt As New MySqlSelectStatement
    stmt.Columns.Add(New SelectColumn("JOB"))
    stmt.Tables.Add(New SelectTable("emp"))
    stmt.Distinct = True
    
    'select distinct JOB from emp
    Dim queryText As String = stmt.ToString
    See Also