Sets group by statement
@param $sql
@param $arguments
@return $this
355958
public function having($sql, array $arguments)
    {
        $this->havingSql       = ' HAVING ' . $sql;
        $this->havingArguments = $arguments;
        return $this;
    }
938745
public function columnRaw(string $sql, string ...$params)
    {
        $this->addColumn($this->dialect()->quote($sql), null, $params);

        return $this;
    }
595507
private function _exec($sql, $arguments = array())
    {
        $sql = $this->replaceArgs($sql, $arguments);

        // executes the statement
        $result = $this->_conn->query($sql);
        if ($this->_conn->errno > 0) {
            throw new DbException(
                "Failed to execute the statement: " .
                "({$this->_conn->errno}) {$this->_conn->error}"
            );
        }

        return $result;
    }
1364737
function sql($sql = null, $params = NULL) {
        $params = $this->autoarr($params);
        $sql = str_replace('table.',$this->alias.'.',$sql);
        return $this->execute($sql, $params);
        return $this;
    }
892351
public @NotNull QueryBuilder append(@NotNull String sql, @NotNull Collection<?> args) {
        query.append(requireNonNull(sql));
        addArguments(args);
        return this;
    }
184437
public function orderByRaw(string $sql, string ...$params)
    {
        $instance = $this->orderByStrategyInstance();

        $instance->orderByStrategy()->orderByRaw($sql, ...$params);

        return $instance;
    }
228031
public function raw(string $sql, string ...$params)
    {
        $this->addCondition('AND', '(' . $this->dialect()->quote($sql) . ')', $params);

        return $this;
    }
865581
protected function setRange($arguments)
    {
        $this->query->setStart($this->getOffset($arguments));
        $this->query->setRows($this->getCount($arguments));
    }
29236
public function setGroupBy($column)
    {
        $this->groupBy = (isset($this->groupBy) ? $this->groupBy.',' : '').$column;

        return $this;
    }
804912
public function groupBy(string $sql, array $params = []) : self
    {
        $this->qiterator = null;
        $this->group = [ $sql, $params ];
        return $this;
    }
1008929
public function setSQL($sql)
    {
        $this->sql = $sql;
        $this->pos = 0;
        $this->len = strlen($sql);
    }
723712
public function groupBy($query = [])
    {
        if (!empty($query)) {
            $i = 0;
            $groupBy = $this->getOrderBy();

            foreach ($query as $value) {
                if ($i>0) {
                    $groupBy .= ', ' . $this->table() . '.' . $value;
                } else {
                    $groupBy .= ' GROUP BY ' . $this->table() . '.' . $value;
                }

                $i++;
            }

            $this->setGroupBy($groupBy);
        }

        return $this;
    }
1316536
public function fromRaw(?string $alias, string $sql, string ...$params)
    {
        $tableKey = null;

        if ($alias) {
            $tableKey = $alias;

            $alias = $this->dialect()->quoteName($alias);
        }

        $this->addFrom($tableKey, $this->dialect()->quote($sql), $alias, $params);

        return $this;
    }
247555
public function orderByRaw($sql, $bindings = array())
	{
		$type = 'raw';

		$this->orders[] = compact('type', 'sql');

		$this->bindings = array_merge($this->bindings, $bindings);

		return $this;
	}
712039
public function setSqlStatement($sqlStatement, array $SqlBinds = [])
    {
        $this->sqlStatement = $sqlStatement;
        $this->sqlBinds = $SqlBinds;

        return $this;
    }
163139
protected function _Where($Sql) {
      // Figure out the concatenation operator.
      $Concat = '';
      
      if(count($this->_Wheres) > 0) {
         $Concat = str_repeat(' ', $this->_WhereGroupCount + 1) . $this->_WhereConcat . ' ';
      }
      
       // Open the group(s) if necessary.
      while($this->_OpenWhereGroupCount > 0) {
         $Concat .= '(';
         $this->_OpenWhereGroupCount--;
      }
      
      // Revert the concat back to 'and'.
      $this->_WhereConcat = $this->_WhereConcatDefault;
      
      $this->_Wheres[] = $Concat . $Sql;

      return $this;
   }
1131488
public function orHavingRaw(string $sql, string ...$params)
    {
        $this->hConditions()->orRaw($sql, ...$params);

        return $this;
    }