Jump to content

showing the biggest number


vikela

Recommended Posts

AmandaF, it's uncertain which column the user wants the MAX of. It may not be ID, but your solution is a good one if that is the case. :)

 

If vikela doesn't want the ID, then

 

SELECT ID, colum_that_vikela_wants_the_max_of FROM table ORDER BY column_that_vikela_wants_the_max_of LIMIT 1

 

Of course, if the column isn't unique and more than one row has the max value, then only one of those rows will get returned.  In that case, it would be better to use the max() function.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.