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

@return  $this
334692
public function count($column = '*', bool $distinct = false): self
    {
        if (!is_array($column)) {
            $column = [$column];
        }
        $distinct = $distinct || (count($column) > 1);
        return $this->addFunction('aggregateFunction', 'COUNT', $column, ['distinct' => $distinct]);
    }
884471
public function max($column, bool $distinct = false)
    {
        parent::max($column, $distinct);
        return $this->getColumnResult();
    }
1234563
public function columnsFrom($table, string $column, string ...$columns)
    {
        $this->from($table);

        list($tableAlias, $tableName) = $this->dialect()->parseTable($table);

        if (!$tableAlias) {
            $tableAlias = $tableName;
        }

        array_unshift($columns, $column);

        foreach ($columns as &$column) {
            $column = $tableAlias . '.' . $column;
        }
        unset($column);

        $this->columns(...$columns);

        return $this;
    }
748395
public function column($column = '*')
    {
        if ('*' == $column) {
            $this->columns = ['*'];
        } else {
            $columns = $this->prepareNames(func_get_args());
            $this->columns = array_merge(
                empty($this->columns) || ['*'] == $this->columns ? [] : $this->columns,
                array_values(array_diff($columns, ['*']))
            );
        }
        return $this;
    }
636814
public function setIdentityColumn($column)
    {
        $columns = $this->getUniqueColumns();

        if (!isset($columns[$column])) {
            throw new \DomainException('Column ' . $column . 'is not unique');
        }

        $this->_identity_column = $column;
        return $this;
    }
508227
public function dropUnique($columns)
    {
        $unique = new Unique($columns, $this);

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

        return $this;
    }
1302701
public function protect($column)
	{
		if($column === false)
		{
			$this->protected = [];
		}
		else
		{
			$this->protected = array_unique(array_merge($this->protected, (array) $column));
		}

		return $this;
	}
261469
public function distinct($column)
    {
        if (!is_null($this->select)) {
            $this->select .= " distinct `$column`";
        } else {
            $this->select = "distinct `$column`";
        }

        return $this;
    }
682248
public function select($type = null, $distinct = false)
    {
        $type = $this->createSelectData($type);

        if ($distinct === true) {
            $this->append('SELECT DISTINCT ' . $type);
        } else {
            $this->append('SELECT ' . $type);
        }

        // Save selected data (to be used when guessing count query)
        $this->selected = $type;
        return $this;
    }
1045622
public function distinct($flag = true)
    {
        $this->_parts[self::DISTINCT] = (bool) $flag;
        return $this;
    }
462775
public function addEncryptionSelect($column = [])
    {
        $columnName = (isset($column['alias']) && !empty($column['alias'])) ? $column['alias'] : $column['column'];
        $this->encryptionColumns[$columnName] = $column;

        return $this;
    }
106837
public function findDistinct($distinct) {
        $this->_detectEntity($distinct);
        $this->_distinct = $distinct;
        $this->_type = self::QUERY_DISTINCT;
        $this->_getSelect();

        return $this;
    }
404851
public function addSelect($column)
    {
        $column = is_array($column) ? $column : func_get_args();

        $this->columns = array_merge((array) $this->columns, $column);

        return $this;
    }
1145196
final public function whereIn(string $column, array $values)
    {
        $this->query->addWhereIn($column, $values);

        return $this;
    }
37784
public function min($column, bool $distinct = false)
    {
        parent::min($column, $distinct);
        return $this->getColumnResult();
    }
304624
public function set( $column, $expression )
    {
        $column = $this->getIdentifier( $column );
        $expression = $this->getIdentifier( $expression );
        $this->values[$column] = $expression;
        return $this;
    }
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;
    }