@param   string $column
@param   bool $distinct (optional)

@return  $this
554686
public function sum($column, bool $distinct = false): self
    {
        return $this->addFunction('aggregateFunction', 'SUM', $column, ['distinct' => $distinct]);
    }
200052
public function addUnique($columns)
    {
        $unique = new Unique($columns, $this);

        $this->actions[] =  function () use ($unique) {
             return $this->manipulation->create($unique);
        };

        return $this;
    }
349549
public function setSortColumn($column)
    {
        $this->sortColumn = null;

        $found = false;
        foreach ($this->getColumns() as $id => $params) {
            if ($id == $column) {
                $found = ($params['sortable'] === true);
                break;
            }
        }

        if ($found)
            $this->sortColumn = $column;

        return $this;
    }
886147
public function distinct(bool $value = true)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->distinct($value);

        return $instance;
    }
309381
public function sum($column, bool $distinct = false)
    {
        parent::sum($column, $distinct);
        return $this->getColumnResult();
    }
37784
public function min($column, bool $distinct = false)
    {
        parent::min($column, $distinct);
        return $this->getColumnResult();
    }
1346882
public function groupBy(string $column)
    {
        $instance = $this->groupByStrategyInstance();

        $instance->groupByStrategy()->groupBy($column);

        return $instance;
    }
1118393
public function setDistinct($distinct = true)
    {
        $this->distinct = $distinct;
        $this->queryBuilder->distinct($distinct);
        return $this;
    }
1373523
public function group($columns)
    {
        settype($columns, 'array'); //force to an array

        $this->group = array_unique(array_merge($this->group, $columns));
        return $this;
    }
1175364
public function max($column, bool $distinct = false): self
    {
        return $this->addFunction('aggregateFunction', 'MAX', $column, ['distinct' => $distinct]);
    }
986015
public function select($select, $distinct = null)
    {
        if (null !== $distinct) {
            $this->distinct($distinct);
        }

        if (empty($select)) {
            return $this;
        }

        $builder = $this->getLookupBuilder();
        $parts = [];
        if (is_array($select)) {
            foreach ($select as $key => $part) {
                if (is_string($part)) {
                    $newSelect = $builder->buildJoin($this, $part);
                    if ($newSelect) {
                        list($alias, $column) = $newSelect;
                        $parts[$key] = $alias.'.'.$column;
                    } else {
                        $parts[$key] = $part;
                    }
                } else {
                    $parts[$key] = $part;
                }
            }
        } elseif (is_string($select)) {
            $newSelect = $builder->buildJoin($this, $select);
            if ($newSelect) {
                list($alias, $column) = $newSelect;
                $parts[$alias] = $column;
            } else {
                $parts[] = $select;
            }
        } else {
            $parts[] = $select;
        }

        $this->sqlParts['select'] = $parts;

        return $this;
    }
598670
public function count($column = '*', bool $distinct = false)
    {
        parent::count($column, $distinct);
        return $this->getColumnResult();
    }
1301695
public function hasColumn($column)
    {
        $this->schema = self::SELECT.' COUNT(COLUMN_NAME) FROM
                        '.$this->getSchemaQuery()."
                        AND COLUMN_NAME = '".$column."' ";

        $this->checkSchemaExistence = true;

        return $this;
    }
1279957
public function groupBy($column)
    {
        if (is_array($column)) {
            $this->groupBy = array_merge($this->groupBy[], array_values($column));
        } else {
            $this->groupBy[] = $column;
        }

        return $this;
    }
589898
public function setConfirm($message, $column = null)
	{
		$this->checkPropertyStringOrCallable($message, 'confirmation message');

		$this->confirm = [$message, $column];

		return $this;
	}
771155
final public function distinct($boolean = TRUE)
    {
        $this->arrayDistinct = (is_bool($boolean)) ? $boolean : TRUE;
        return $this;
    }
915411
public function distinct($field)
    {
        $this->query['type'] = Query::TYPE_DISTINCT;
        $this->query['distinct'] = $field;
        return $this;
    }