(No version information available, might only be in Git)
TableSelect::having — Set select having condition
$sort_expr
)Sets a condition for records to consider in agregate function operations.
sort_expr
A condition on the agregate functions used on the grouping criteria.
A TableSelect object.
Example #1 mysql_xdevapi\TableSelect::having() example
<?php
$sel = $table->select(['age as age_group', 'count(name) as cnt'])->groupBy('age_group');
$sel = $sel->where("age > 11 and 1 < 2 and 40 between 30 and 900");
$sel = $sel->having('cnt > 1');
$sel = $sel->orderBy('age_group desc');
$res = $sel->limit(2)->offset(1)->execute();
?>