You are here

public function Select::having in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::having()

Adds an arbitrary HAVING clause to the query.

Parameters

$snippet: A portion of a HAVING clause as a prepared statement. It must use named placeholders, not ? placeholders.

$args: (optional) An associative array of arguments.

Return value

$this

Overrides SelectInterface::having

File

core/lib/Drupal/Core/Database/Query/Select.php, line 305

Class

Select
Query builder for SELECT statements.

Namespace

Drupal\Core\Database\Query

Code

public function having($snippet, $args = []) {
  $this->having
    ->where($snippet, $args);
  return $this;
}