@param mixed $column
@param int   $amount

@return \Swoft\Core\ResultInterface
548234
public function counter($column, $amount = 1): ResultInterface
    {
        $this->update = $this->getTableName();
        if (is_array($column)) {
            $this->counterValues = $column;
        } else {
            $this->counterValues = [$column => $amount];
        }

        return $this->execute();
    }
1012203
public function sum($column = null)
    {
        $this->prepare();

        $sum = 0;
        if (is_null($column)) {
            $sum = array_sum($this->_map);
        } else {
            foreach ($this->_map as $key => $val) {
                $value = $this->getFromNested($val, $column);
                if (is_scalar($value)) {
                    $sum += $value;
                }

            }
        }

        return $sum;
    }
402384
public function get($column)
    {
        foreach ($this->expressions as $expr) {
            if ($expr->getColumn() == $column) {
                return $expr;
            }
        }

        return null;
    }
661474
public function create($amount, $currency)
    {
        $result = new Money($amount, $currency);
        $this->validator->validateMoney($result);
        return $result;
    }
894268
protected function incrementOrDecrementAttributeValue( $column, $amount, $method )
	{
		$this->{$column} = $this->{$column} + ( $method == 'increment' ? $amount : $amount * -1 );

		$this->syncOriginalAttribute( $column );
	}
1203074
public function dec($field, $amount = 1) {
        $this->checkIncOrDecAmount($amount);

        $data = [$field => ['exp', "{$field} - {$amount}"]];
        return $this->update($data);
    }
1036010
public function getColumn($column = 0)
    {
        $this->parseDefer();
        if(!$this->isSuccess)
        {
            throw new \RuntimeException('Result is not success!');
        }
        return $this->statement->fetchAll(\PDO::FETCH_COLUMN, $column);
    }
509440
public function count(string $column = '*', string $alias = 'count'): ResultInterface
    {
        $this->aggregate['count'] = [$column, $alias];
        $this->addAggregateDecorator($alias);

        return $this->execute();
    }
930595
public function sum($column)
    {
        return $this->column($column)->reduce(function ($carry, $item) {
            $carry += $item;

            return $carry;
        });
    }
686658
public function sqlFetchColumn(string $sql, array $params = [], string $column = '0')
    {
        return $this->connection()->sqlFetchColumn($sql, $params, $column);
    }
915808
public function dropColumn(string $column): AbstractTable
    {
        if (empty($schema = $this->current->findColumn($column))) {
            throw new SchemaException("Undefined column '{$column}' in '{$this->getName()}'");
        }

        //Dropping column from current schema
        $this->current->forgetColumn($schema);

        return $this;
    }
526243
public function increment(string $column, int $amount = 1): self
    {
        $this->values[$column] = new RawExp($this->quoter->quoteName($column) . '+' . $this->quoter->quoteValue($amount));

        return $this;
    }
1190448
public function groupBy(string $column): CollectionInterface
    {
        $return = [];

        foreach ($this->toArray() as $item) {
            if (isset($item[$column])) {
                $key = $item[$column];
                $return[$key] = $item;
            }
            // Must throw exception if item column does not exists
        }

        return new Collection($return);
    }
965117
public function setColumns(int $amount)
    {
        if (!$amount) {
            throw new InvalidArgumentException('Columns amount must be set');
        }

        if ($this->columns === $amount) {
            return $this;
        }

        foreach ($this->structure as &$v) {
            if ($this->columns < $amount) {
                // Add rows
                $v += $amount ? array_fill(0, $amount, $this->cell_example) : [];
            } else {
                // Remove rows from the end
                $v = \array_slice($v, 0, $amount);
            }
        }
        unset($v);

        $this->columns = $amount;

        return $this;
    }
668079
public function setRows(int $amount)
    {
        if (!$amount) {
            throw new InvalidArgumentException('Rows amount must be set');
        }

        if ($this->rows === $amount) {
            return $this;
        }

        if ($this->rows < $amount) {
            // Add rows
            for ($i = $amount - $this->rows; $i > 0; $i--) {
                $this->structure[] = $this->columns ? array_fill(0, $this->columns, $this->cell_example) : [];
            }
        } else {
            // Remove rows from the end
            $this->structure = \array_slice($this->structure, 0, $amount);
        }

        $this->rows = $amount;

        return $this;
    }
242973
public function select($column, $as = null, $count = false)
	{
		$this->syntax->setSelect($column, $as, $count);
		$this->type = 'select';
		return $this;
	}
419079
public function chunk($count, $callback, $column = null)
    {
        $options = $this->getOptions();
        if (isset($options['table'])) {
            $table = is_array($options['table']) ? key($options['table']) : $options['table'];
        } else {
            $table = '';
        }
        $column    = $column ?: $this->getPk($table);
        if (isset($options['order'])) {
            unset($options['order']);
        }
        $bind      = $this->bind;
        $resultSet = $this->options($options)->limit($count)->order($column, 'asc')->select();
        if (strpos($column, '.')) {
            list($alias, $key) = explode('.', $column);
            unset($alias);
        } else {
            $key = $column;
        }

        while (!empty($resultSet)) {
            if (false === call_user_func($callback, $resultSet)) {
                return false;
            }

            $end    = end($resultSet);
            $lastId    = is_array($end) ? $end[$key] : $end->$key;
            $resultSet = $this->options($options)
                ->limit($count)
                ->bind($bind)
                ->where($column, '>', $lastId)
                ->order($column, 'asc')
                ->select();
        }
        return true;
    }