MAX Function in SQL Server

MAX is an aggregate function which is used to obtain the maximum value out of all the values in a particular column.

Syntax:

SELECT MAX (<Column Name>) from <Table Name>

Example:

We have a table with the following data in the table SALES.

ITEMPRICE
ABC99.05
ABC1110.99
ABC270.89
ABC3100.99
ABC455.89

In order find out the maximum price out of all the sales we should use MAX function.

QUERY:

SELECT MAX(PRICE) FROM SALES

Result Set:













Result set contains maximum value of all the values in PRICE column.

This entry was posted in , . Bookmark the permalink.

Leave a reply