Re: SQL order by queries
| From: | David Robley | Date: | Sun, 28 Jul 2002 03:56:49 +0000 |
| Subject: | Re: SQL order by queries | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20842@lists.php.net to get a copy of this message | ||
In article <20020726230610.92748.qmail@pb1.pair.com>,
webmaster@filmfind.tv says...
> Can you d arithmetic division on two fields in an ORDER BY??
>
> eg
> SELECT * FROM table_name ORDER BY field1 / field2 DESC
>
> Can it be done?
Probably would work - give it a try :-) If you want to use the value you
are ordering on, try
ELECT * FROM table_name ORDER BY field1 / field2 AS something DESC
then you can retrieve the reuslt of the division as $something.
Cheers
--
David Robley
Temporary Kiwi!
Quod subigo farinam