minimum()

Description

Calculates the minimum value for a given property. Uses the SQL function MIN.

Function Syntax

minimum(property [, where, include ])

Parameters

Parameter Type Required Default Description
property string Yes Name of the property to get the lowest 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 lowest salary for all employees --->
<cfset lowestSalary = model("employee").minimum("salary")>