Woops, sent this to support. Sorry Support! > -----Original Message----- > From: Luc Foisy > Sent: Wednesday, July 10, 2002 1:37 PM > To: 'Mysql-Support (E-mail) > Subject: RE: calculating inside query > > > > -----Original Message----- > > Hi there, > > > > I would like to find out the top 10 of some ratings. There > > are 2 columns. > > One for the rating and one for the amount of ratings. > > To find out the top 10 I would have to divide those 2 values > > and sort it. > > > > Somehow this does not work. I do not have a clue why. Maybe > > someone of you > > guys do see the error: > > > > SELECT > > ID, > > rating_total / ratings_amount AS top10 > > FROM rating > > ORDER BY top10 desc > > LIMIT 10 > > > > Thanx for any help, > > > > Andy > > query > > Try ORDER BY (rating_total / ratings_amount) desc > and you may want to quote your alias AS 'top10' >
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php