public static function sqlBuildGroupBy($arrGroup, $addGroup = false)
    {
        $groupBy = $group = null;
        
        if (is_array($arrGroup))
        {
            $group = '';
            foreach ($arrGroup as $k)
            {
                if ($group)  $group .= ', ';
                $group .= self::getDSN()->escape($k);
            }
        }
        
        if ($addGroup && $group)
            $groupBy = ' GROUP BY ' . $group;
        
        return $groupBy;    
    }