yii\db\Query::min PHP Method

min() public method

Returns the minimum of the specified column values.
public min ( string $q, Connection $db = null ) : mixed
$q string the column name or expression. Make sure you properly [quote](guide:db-dao#quoting-table-and-column-names) column names in the expression.
$db Connection the database connection used to generate the SQL statement. If this parameter is not given, the `db` application component will be used.
return mixed the minimum of the specified column values.
    public function min($q, $db = null)
    {
        return $this->queryScalar("MIN({$q})", $db);
    }