1 select.inc public SelectQuery::union(SelectQueryInterface $query, $type = '')

Return value

SelectQuery:

Overrides SelectQueryInterface::union

File

core/includes/database/select.inc, line 1820
Contains classes and interfaces for Select queries.

Class

SelectQuery
Query builder for SELECT statements.

Code

public function union(SelectQueryInterface $query, $type = '') {
  // Handle UNION aliasing.
  switch ($type) {
    // Fold UNION DISTINCT to UNION for better cross database support.
    case 'DISTINCT':
    case '':
      $type = 'UNION';
      break;

    case 'ALL':
      $type = 'UNION ALL';
    default:
  }

  $this->union[] = array(
    'type' => $type,
    'query' => $query,
  );

  return $this;
}