It's actually pretty easy -

select * from table order by creation_date desc limit 1

Now one catch to this use of LIMIT is that you only get one row - even
if there are multiple rows that share the same greatest creation_date.
Sometimes that's acceptable, sometimes not.

Dan


On 12/7/06, Tim McIntyre <[EMAIL PROTECTED]> wrote:
Hey all

I would guess this would be a pretty simple question.

How do I select a row whose value for a given column is the greatest
or the least or whatever for that table?

e.g:
select * from table where creation_date > all_other_creation_dates;

Hope that makes some sense.  Thanks in advance!
Tim










--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to