All Functions
WHERE Clause
HAVING Clause
GROUP BY Clause
FUNCTION: MIN
SELECT MIN(field) AS [expression]
FROM table
[WHERE ...]
[GROUPBY ...]
[HAVING ...]
The
MIN
function is one of the aggregate functions that are used to calculate statistical information for a specified numeric field in a query. The other aggregate functions are:
AVG, COUNT, MAX, STDEV, STDEVP, SUM, VAR, VARP
. Note that all of these functions return a single value.
The
MIN
function simply finds the lowest, or minimum, value in a field.
This code finds the shortest hospital stay by a MediCare patient over the age of 65 and stores that information in MinStay.
SELECT MIN(DaysInHospital) AS [MinStay]
FROM MediCarePatients
WHERE age > 65
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information