上一篇《統計方法: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