バージョン: 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}";