# phpDox - Query\QueryBuilder::selectMax

# Query\QueryBuilder::selectMax

#### Selects the maximum value of a field from a query

## Signature

`public function selectMax(string $field, [boolean $as = FALSE] )`

## Parameters

`$field` — string
`$as` — boolean

## Returns

QueryBuilder

## Defined by Interface

`QueryBuilderInterface`

## Violations

### PHPMessDetector

Line | Rule | Message
--- | --- | ---
80 | BooleanArgumentFlag | The method selectMax has a boolean flag argument $as, which is a certain sign of a Single Responsibility Principle violation.
80 | ShortVariable | Avoid variables with short names like $as. Configured minimum length is 3.