public function toSQL(Parameters $params, bool $inner_clause)
    {
        $alias = $this->alias;

        $drv = $params->getDriver();
        $sql = $drv->toSQL($params, $this->expression, true);

        if (empty($this->alias))
            $this->alias = $params->generateAlias($this->expression);

        if (!empty($this->alias))
            return $sql . ' AS ' . $drv->identQuote($this->alias);

        return $sql;
    }