function group_by($by)
{
if (is_string($by)) {
$by = explode(',', $by);
}
foreach ($by as $val) {
$val = trim($val);
if ($val != '') {
$this->ar_groupby[] = $this->_protect_identifiers($val);
if ($this->ar_caching === TRUE) {
$this->ar_cache_groupby[] = $this->_protect_identifiers($val);
$this->ar_cache_exists[] = 'groupby';
}
}
}
return $this;
}