Saturday, November 19, 2011

SQL - MAX


The MAX aggregate function allows us to select the highest (maximum) value for a certain column.

The MAX function syntax is very simple and it looks like this:

SELECT MAX(Column1)
FROM Table1

If we use the Customers table from our previous chapters, we can select the highest date of birth with the following MAX expression:

SELECT MAX(DOB) AS MaxDOB
FROM Customers

No comments:

Post a Comment