src/Builder/Syntax/SelectWriter.php
protected function writeSelectQuery(Select $select)
    {
        $parts = ['SELECT'];

        if ($select->isDistinct()) {
            $parts[] = 'DISTINCT';
        }

        $this->writeSelectColumns($select, $parts);
        $this->writeSelectFrom($select, $parts);
        $this->writeSelectJoins($select, $parts);
        $this->writeSelectWhere($select, $parts);
        $this->writeSelectGroupBy($select, $parts);
        $this->writeSelectHaving($select, $parts);
        $this->writeSelectOrderBy($select, $parts);
        $this->writeSelectLimit($select, $parts);

        return AbstractBaseWriter::writeQueryComment($select).implode(' ', \array_filter($parts));
    }
protected function writeSelectQuery(Select $select)
    {
        $parts = ['SELECT'];

        if ($select->isDistinct()) {
            $parts[] = 'DISTINCT';
        }

        $this->writeSelectColumns($select, $parts);
        $this->writeSelectFrom($select, $parts);
        $this->writeSelectJoins($select, $parts);
        $this->writeSelectWhere($select, $parts);
        $this->writeSelectGroupBy($select, $parts);
        $this->writeSelectHaving($select, $parts);
        $this->writeSelectOrderBy($select, $parts);
        $this->writeSelectLimit($select, $parts);

        return AbstractBaseWriter::writeQueryComment($select).implode(' ', \array_filter($parts));
    }
@param Select $select

@return string