protected function handleHavings(array $havings, $prefix = true)
    {
        if (empty($havings)) {
            return '';
        }

        $sql[] = $this->{$havings[0]['type']}($havings[0]);


        $count = count($havings);

        for ($i = 1; $i < $count; $i++) {
            $sql[] = $havings[$i]['separator'] . ' ' . $this->{$havings[$i]['type']}($havings[$i]);
        }

        return ($prefix ? ' HAVING ' : '') . implode(' ', $sql);
    }