At 03:10 PM 12/7/2006, Tim McIntyre 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

Tim,
        You can also try:

select min(Creation_date) MinDate, max(Creation_Date) from tablex;

If the creation_date is indexed, it should be quite fast.

Since you're stumbling on simple queries like this one, you may want to go out and purchase MySQL Cookbook 2nd edition. It has hundreds of useful "How To's" that will help to increase your MySQL IQ. Get it for Christmas. It makes a great stocking stuffer (depending on how big your feet are!). :)

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

Reply via email to