版本: v2.3.0
max
返回指定列的最大值。
max($table, $column, $where)
table [string]
要查询的数据表名称。
column [string]
要计算的列。
where [array] (可选)
用于筛选结果集的 WHERE 条件。
max($table, $join, $column, $where)
table [string]
要查询的数据表名称。
join [array]
用于关联相关数据表的 JOIN 定义;如果不需要 JOIN,可省略此参数。
column [string]
要计算的列。
where [array] (可选)
用于筛选结果集的 WHERE 条件。
返回值
[mixed] 返回指定列中的最大值。
$max = $database->max("account", "age", [
"gender" => "female"
]);
echo "年龄最大的女性用户为 {$max}";