@param string $column
@param string $alias

@return ResultInterface
509440
public function count(string $column = '*', string $alias = 'count'): ResultInterface
    {
        $this->aggregate['count'] = [$column, $alias];
        $this->addAggregateDecorator($alias);

        return $this->execute();
    }
1322460
public function alias(string $alias, ?string $table = null): IQueryBuilderHandler
    {
        if ($table === null && isset($this->statements['tables'][0]) === true) {
            $table = $this->statements['tables'][0];
        } else {
            $table = $this->tablePrefix . $table;
        }

        $this->statements['aliases'][$table] = \strtolower($alias);

        return $this;
    }
1274950
public function chunkById($count, callable $callback, $column = null, $alias = null)
    {
        $column = is_null($column) ? $this->getModel()->getKeyName() : $column;

        $alias = is_null($alias) ? $column : $alias;

        $lastId = 0;

        do {
            $clone = clone $this;

            // We'll execute the query for the given page and get the results. If there are
            // no results we can just break and return from here. When there are results
            // we will call the callback with the current chunk of these results here.
            $results = $clone->forPageAfterId($count, $lastId, $column)->get();

            $countResults = $results->count();

            if ($countResults === 0) {
                break;
            }

            // On each chunk result set, we will pass them to the callback and then let the
            // developer take care of everything within the callback, which allows us to
            // keep the memory low for spinning through large result sets for working.
            if ($callback($results) === false) {
                return false;
            }

            $lastId = $results->last()->{$alias};
        } while ($countResults === $count);

        return true;
    }
205997
public function column(string $column, ?string $alias = null)
    {
        list($columnAlias, $column) = $this->dialect()->parseName($column);

        if (!$alias) {
            $alias = $columnAlias;
        }

        if ($alias) {
            $alias = $this->dialect()->quoteName($alias);
        }

        $this->addColumn($this->dialect()->quoteName($column), $alias);

        return $this;
    }
793505
public function avg($column, $alias = null)
    {
        $this->queryBuilder->avg($column, $alias);
        return $this;
    }
868616
public function max($column, $alias)
    {
        return $this->addSelectColumn(new Func\Max(new Expr\Column($column)), $alias);
    }
1260898
public function min($column, $alias)
    {
        return $this->addSelectColumn(new Func\Min(new Expr\Column($column)), $alias);
    }
392753
public function innerJoin($table, $criteria = null, $alias = null)
    {
        return $this->join($table, $criteria, self::INNER_JOIN, $alias);
    }
1311085
public function createTable($table, $alias = null)
    {
        $tableObject = $this->facade->createTable($this, $table);

        if ($alias) {
            $tableObject->setAlias($alias);
        }

        return $tableObject;
    }
510964
public function getFieldByAlias($alias)
    {
        foreach ($this->_fields as $column => $fields)
        {
            foreach ($fields as $field)
            {
                if ($field->getAlias() === $alias)
                {
                    return $field;
                }
            }
        }
        return null;
    }
1191299
public function From(string $table, string $alias = ''): QueryBuilder
    {
        $this->table = $table;
        
        if (! empty($alias)) {
            $this->alias = $alias;
        }
        
        return $this;
    }
585831
public function ucase($column, string $alias = null): self
    {
        return $this->column((new Expression())->ucase($column), $alias);
    }
43887
public function column($column = null)
	{
		if($column !== null)
		{
			$this->select([$column]);
		}

		$query = $this->limit(1)->compiler->select();

		return $this->connection->column($query['sql'], $query['params']);
	}
487991
public function alias(String $column, String $alias)
	{
		// if (!$this->getBinding('select') || empty($this->getBinding('select'))) {
			// Since this method cannot be used without the SELECT statement,
			// we will throw an exception if `SELECT` binding is null or false. 
			// throw new RuntimeException(sprintf('Cannot call aggregate function on empty select.'));
		// }
		$alias = str_replace($this->generator->getDisallowedChars(), '', $alias);
		return $this->attachSeparator($column . ' AS ' . $alias);
	}
1249301
public function table($table = null, $alias = null)
    {
        $query = new Table($this); return $query->table($table, $alias);
    }
498745
public function addSum($column, string $alias = null): self
    {
        return $this->addAggregate('SUM', $column, $alias);
    }
652761
public function addMax($column, string $alias = null): self
    {
        return $this->addAggregate('MAX', $column, $alias);
    }