Create and return alias for a column.

@param 	$column <String>
@param 	$alias <String>
@access 	public
@return 	<String>
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);
	}
68472
private function get_alias_property( $alias )
	{
		if ( array_key_exists( $alias, $this->aliases ) )
			return $this->aliases[$alias];

		return $alias;
	}
195459
public function createQueryBuilder($alias = null)
    {
        if ($alias === null) {
            $alias = $this->getAlias();
        }

        if (empty($alias)) {
            $select = '*';
        } else {
            $select = $alias . '.*';
        }

        return $this->em->createQueryBuilder()
            ->select($select)
            ->from($this->getTableName(), $alias);
    }
39542
public function alias($alias)
    {
        $this->alias = $alias;

        if (!in_array('`' . $alias . '`.*', $this->select)) {
            $this->select[] = '`' . $alias . '`.*';
        }

        if (in_array('`' . $this->table . '`.*', $this->select)) {
            unset($this->select[array_search('`' . $this->table . '`.*', $this->select)]);
        }

        return $this;
    }
667053
public function from($table, $alias = null) {
        $this->_table = (string) $table;
        $this->asAlias($alias);

        return $this;
    }
1219262
public function mid($column, int $start = 1, string $alias = null, int $length = 0): self
    {
        return $this->column((new Expression())->mid($column, $start, $length), $alias);
    }
1279872
public function select($column, $alias = null)
    {
        $this->select[$this->columnQuote($column)] = $this->columnQuote($alias);
        
        return $this;
    }
1299821
public function column($name, string $alias = null): self
    {
        $this->sql->addColumn($name, $alias);
        return $this;
    }
712564
public function selectCount(string $column = '*', string $alias = null): string
    {
        return 'SELECT ' . $this->count($column, $alias);
    }
1101789
public function selectSum(string $column, string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->sum($column, $alias);

        return $instance;
    }
643278
public function avg(string $column, string $alias = null): string
    {
        if ($alias) {
            $alias = $this->quoteName($alias);
        }

        return 'AVG(' . $this->quoteName($column) . ')' . ($alias ? ' AS ' . $alias : '');
    }
1042136
public function from($table, $alias = null) {
        $this->from [] = self::parseAs($table, $alias);

        return $this;
    }
354878
public function alias($alias, $key)
    {
        if ($key !== $alias && $this->has($key)) {
            $this->_aliases[$alias] = $key;
        }
        
        return $this;
    }
316025
public function column($column, bool $allowAlias = false): string
	{
		if($column instanceof Raw)
		{
			return $this->raw($column);
		}
		elseif($column instanceof Subquery)
		{
			return $this->subquery($column);
		}
		elseif($allowAlias && stripos($column, ' AS ') !== false)
		{
			[$column, , $alias] = explode(' ', $column, 3);

			return sprintf('%s AS %s', $this->compileColumnName($column), $this->compileColumnName($alias));
		}

		return $this->compileColumnName($column);
	}
749691
public function alias(string $alias = null)
    {
        $clone = clone $this;
        $clone->value = sprintf('%s AS %s', $clone->value, $this->quoter->quoteName($alias));

        return $clone;
    }
155048
public function alias($alias = null)
    {
        if (null === $alias) {
            $alias = $this->getTableAlias();
        }
        $this->oosql_table_alias = $alias;
        return $this;
    }
498745
public function addSum($column, string $alias = null): self
    {
        return $this->addAggregate('SUM', $column, $alias);
    }