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

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


Max方法:Max APIhtml

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

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


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

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


$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 code

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

原文连接: http://loiy.net/post/610.htmlget

相关文章
相关标签/搜索