870c
    if ($isaggregate and $this->groupby) {
.
862a
        $isaggregate = true;
      } else {
        if ($field['alias']) $this->add_groupby($field['alias']);
        else $this->add_groupby($fullname);
.
857a
      $fullname = $string;
.
848a
    $isaggregate = false;
.
790c
    // Only add it if it's not already in there.
.
592a
      if (is_array($params)) {
	$this->fields[$name]['count'] = $params['count'];
	$this->fields[$name]['distinct'] = $params['distinct'];
      }
.
571c
  function add_field($table, $field, $alias = '', $params = null) {
.
53a
   * Note: for this to work in postgres the groupby array must match 
   * the non-aggregate fields in the fields array
   * thus it is important to check the fields before the query is
   * built to see if any are marked as "count" fields
.
