Home SQL Basic SQL Max
SQL Max

If you need to find the maximum value of a column in a table then the SQL MAX fuction would do a perfect job. To use the MAX function you would use the following syntax:

SELECT MAX("column_name")

FROM "table_name"

Table: Student

StudentID LastName FirstName DOB CourseFees CourseName
1 John Astone 07/15/1976 1000.00 Accountant
2 Bob Eastwood 02/13/1935 1500.00 Economic
3 Jane Hollywood 03/23/1939 2000.00 IT
4 Bob Eastwood 03/19/1980 3000.00 Economic

For example to find out the most expensive course fees you would use the following examples:

SELECT MAX(CourseFees)  AS 'Max Course Fees'

FROM Student

RESULT: 

Max Course Fees

3000.00

In this case the 3000.00 is the maximum course fees for the student table following by 2000.00, 1500.00 and 1000.00.

 



Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.

"