MySQL Forums
Forum List  »  Newbie

Re: Using MAX() or MIN()
Posted by: John Winter
Date: June 18, 2005 06:00PM

Hi,

for most popular:

select * from table order by mov_popularity desc limit 1

for least popular:

select * from table order by mov_popularity asc limit 1


min() and max() are only useful when returning 1 field.

Options: ReplyQuote


Subject
Written By
Posted
June 18, 2005 03:00PM
Re: Using MAX() or MIN()
June 18, 2005 06:00PM
June 20, 2005 04:55AM
June 20, 2005 10:17AM
June 20, 2005 10:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.