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

Implements SelectQueryInterface::union().

Return value

SelectQuery:

Overrides SelectQueryInterface::union

File

core/includes/database/select.inc, line 1624

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;
}