Adds a `distinct` clause to the query.
187270
function distinct() {
    this._statements.push({
      grouping: 'columns',
      value: normalizeArr.apply(null, arguments),
      distinct: true
    });
    return this;
  }
846659
def distinct(self, fieldname, key=None):
        
        return tuple(unique_everseen(self[fieldname], key=key))
733706
protected function detectDistinct()
        {
            foreach ($this->criteria as $criteria) {
                if ($criteria->isDistinct()) {
                    $this->is_distinct = true;
                }
            }
        }
1029396
final public function distinct($column)
    {
        if (!is_array($column)) {
            $column = explode(',', $column);
        }
        $column = array_map([$this, 'formatColumn'], $column);

        $this->_sql['distinct'] = array_merge($this->_sql['distinct'], $column);
        return $this;
    }
708161
def distinct(keys):
    
    known = set()
    outlist = []
    for key in keys:
        if key not in known:
            outlist.append(key)
        known.add(key)
    return outlist
478347
public <T> JDOQuery<T> selectDistinct(Expression<T> expr) {
        return query().select(expr).distinct();
    }
1203458
public function select($target = null, $distinct = false)
    {
        $this->queryBuilder->select($target, $distinct);
        return $this;
    }
533592
public function selectDistinct($fields)
    {
        if ($this->overwriteEnabled === true) {
            $this->statements['distincts'] = $fields;
        } else {
            $this->addStatement('distincts', $fields);
        }

        return $this;
    }
1318121
public static <T> SQLQuery<T> selectDistinct(Expression<T> expr) {
        return new SQLQuery<Void>().select(expr).distinct();
    }
1265565
def get_sql_select(self, columns, table, distinct=False):
        """"""
        sql = 'SELECT {0} {1} FROM {2}'
        dist = {True: 'DISTINCT', False: ''}[distinct]
        return sql.format(dist, ', '.join(columns), table)
383187
public void updateUnique(@NotNull SqlQuery query) {
        int modifiedRows = update(query);
        if (modifiedRows != 1)
            throw new NonUniqueUpdateException(modifiedRows);
    }
905268
def distinct_values driver = nil
      @distinct_values ||= values || @filters.values.inject({}){|memo, filter| memo[filter.name] = filter.label; memo }
    end
662651
def get_db_distinct(queryset, field, func, **params):
    
    while True:
        try:
            value = func(**params)
            queryset.get(**{field: value})
        except ObjectDoesNotExist:
            break
    return value
666305
def distinct_on(self, value):
        
        if isinstance(value, str):
            value = [value]
        self._distinct_on[:] = value
84721
private QueryResultImpl eliminateDuplicates(QueryResultImpl result) {
        QueryResultImpl ret = new QueryResultImpl(result.getQuery());
        Set<QueryBindingImpl> distinctSet = new HashSet<>(result.getBindings());
        distinctSet.forEach(ret::add);
        return ret;
    }
412158
def select_distinct(distinct_field=None, **kwargs):
    
    results = search_associations(rows=0,
                                  select_fields=[],
                                  facet_field_limits = {
                                      distinct_field : -1
                                  },
                                  facet_fields=[distinct_field],
                                  **kwargs
    )
    # TODO: map field
    return list(results['facet_counts'][distinct_field].keys())
385166
def _query(cls, *args, **kwds):
    
    # Validating distinct.
    if 'distinct' in kwds:
      if 'group_by' in kwds:
        raise TypeError(
            'cannot use distinct= and group_by= at the same time')
      projection = kwds.get('projection')
      if not projection:
        raise TypeError(
            'cannot use distinct= without projection=')
      if kwds.pop('distinct'):
        kwds['group_by'] = projection

    # TODO: Disallow non-empty args and filter=.
    from .query import Query  # Import late to avoid circular imports.
    qry = Query(kind=cls._get_kind(), **kwds)
    qry = qry.filter(*cls._default_filters())
    qry = qry.filter(*args)
    return qry