Click to Rate and Give Feedback
TechNet
TechNet Library
SQL Server
SQL Server 2005
 MIN (SQL Server Compact Edition)
Collapse All/Expand All Collapse All
SQL Server 2005 Compact Edition Books Online
MIN (SQL Server Compact Edition)

Returns the minimum value in the expression.

MIN ( [ ALL ] expression ) 
ALL

Applies the aggregate function to all values. ALL is the default.

expression

A constant, column name, or function, and any combination of arithmetic, bitwise, and string operators. MIN can be used with numeric, nchar, nvarchar, or datetime columns but not with bit columns. Aggregate functions and subqueries are not permitted.

Returns a value of the same type as expression.

MIN ignores any null values.

With character data columns, MIN finds the value that is lowest in the sort sequence.

The following example uses MIN to determine the lowest priced item in the Products table.

SELECT MIN(UnitPrice) AS "Least Expensive" FROM Products

This is the result set:

Least Expensive
---------------
2.5
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker