您的位置:首页 > 其它

Max方法:Max API-Medoo使用指南 ​

2014-06-04 22:53 267 查看
上一篇《统计方法:Count API-Medoo使用指南》中介绍了如何使用Medoo的Count方法来统计记录的行数。本篇将要介绍使用Max方法来获取列的最大值。

Max方法:Max API

使用Max方法获取列的最大值。

max($table, $column, $where)
//table [string]: 表名
//column [string]: 将要被计算的目标列
//where (可选)[array]:WHERE子句筛选记录


返回值: [number]:列的最大值。

提示:返回值的数据类型是数字。

$database = new medoo("my_database");

$max = $database->max("account", "age", [
"gender" => "female"
]);

echo "The age of oldest female user is " . $max;


Medoo版本: 0.9.1.1

原文标题: Max方法:Max API-Medoo使用指南

原文链接: http://loiy.net/post/610.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: