SQL > SQL Functions > MIN Function

SQL uses the MIN function to find the maximum value in a column. The syntax for using the MIN function is,

SELECT MIN ("column_name")
FROM "table_name";

For example, if we want to get the lowest sales from the following table,

Table Store_Information

Store_NameSalesTxn_Date
Los Angeles1500Jan-05-1999
San Diego250Jan-07-1999
Los Angeles300Jan-08-1999
Boston700Jan-08-1999

we would type in

SELECT MIN(Sales) FROM Store_Information;

Result:

MIN(Sales)
250

250 represents the smallest value of all Sales entries: 1500, 250, 300, and 700.

Next: SQL SUM




Copyright © 2014   1keydata.com   All Rights Reserved.     Privacy Policy     About   Contact