How to find greatest number in a database table?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

How to find greatest number in a database table?

Post by ljCharlie »

I need to find the greatest number in my MySQL database table. What is the SQL statement will accomplish this?

Thanks!
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post by ljCharlie »

Never mind. I got it.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

It's always nice if you let the others know what the solution was... :)

Code: Select all

SELECT MAX(columnname)
FROM tablename
Post Reply