protected function compileUnionAggregate(Builder $query)
    {
        $sql = $this->compileAggregate($query, $query->aggregate);

        $query->aggregate = null;

        return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table');
    }
protected function compileUnionAggregate(Builder $query)
    {
        $sql = $this->compileAggregate($query, $query->aggregate);

        $query->aggregate = null;

        return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table');
    }
protected function compileUnionAggregate ( Builder $ query ) { $ sql = $ this -> compileAggregate ( $ query , $ query -> aggregate ) ; $ query -> aggregate = null ; return $ sql . ' from (' . $ this -> compileSelect ( $ query ) . ') as ' . $ this -> wrapTable ( 'temp_table' ) ; }
Compile a union aggregate query into SQL.

@param  \Illuminate\Database\Query\Builder  $query
@return string
Compile a union aggregate query into SQL .