public function get_having(array $cfg): string
  {
    $res = '';
    if ( !empty($cfg['group_by']) && !empty($cfg['having']) && ($cond = $this->get_conditions($cfg['having'], $cfg, true)) ){
      $res .= 'HAVING '.$cond.PHP_EOL;
    }
    return $res;
  }