maximum()

Description

Calculates the maximum value for a given property. Uses the SQL function MAX.

Function Syntax

maximum(property [, where, include ])

Parameters

Parameter Type Required Default Description
property string Yes Name of the property to get the highest value for (has to be a property of a numeric data type).
where string No An SQL fragment such as lastName LIKE 'A%' for example.
include string No Any associations that need to be included in the query.

Examples

<!--- Get the amount of the highest salary for all employees --->
<cfset highestSalary = model("employee").maximum("salary")>