Re: Calculating inside query?

From: Date: Wed, 10 Jul 2002 16:48:19 +0000
Subject: Re: Calculating inside query?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-20462@lists.php.net to get a copy of this message
there is no error, it just does not pull out the right values. Just puts out 10 listings and the top10 column (as I named it by alias) contains no value. I am using mysql. maybe this has to do somehting with the alias? "Ryan Jameson" <RJameson@usa.ibs.org> schrieb im Newsbeitrag news:CC8578B824E74940BA5126774F49628D015A7B05@NATHAN.ibs.org... i assume you're using MySQL because of the Limit clause, but what error are you receiving? -----Original Message----- From: andy [mailto:news.letters@gmx.de] Sent: Wednesday, July 10, 2002 10:34 AM To: php-db@lists.php.net Subject: [PHP-DB] Calculating inside query? 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: Mysql: SELECT ID, rating_total / ratings_amount AS top10 FROM rating ORDER BY top10 desc LIMIT 10 Thanx for any help, Andy query -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#20462) next »