private function getFromClause()
    {
        $fromClauses = array();

        foreach ($this->parts['from'] as $from) {
            $fromClause = $from['table'];

            if ($from['alias'] !== null) {
                $fromClause .= ' '.$from['alias'];
            }

            if (isset($this->parts['join'][$from['alias']])) {
                foreach ($this->parts['join'][$from['alias']] as $join) {
                    $fromClause .= ' '.strtoupper($join['type']).
                                   ' JOIN '.$join['table'].' '.$join['alias'].
                                   ' ON '.$join['expression'];
                }
            }

            $fromClauses[] = $fromClause;
        }

        return implode(', ', $fromClauses);
    }