RE: [PHP] divide-column?
| From: | Murray @ PlanetThoughtful | Date: | Tue, 30 Aug 2005 08:23:33 +0000 |
| Subject: | RE: [PHP] divide-column? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221568@lists.php.net to get a copy of this message | ||
> Hi there!
>
> How do I do a sort in PHP where a column in a db must be two other columns
> divided...`?
<snip>
Hi Gustav,
You should be able to use the divide operation in your query's ORDER BY
clause.
Eg
SELECT * FROM mytable ORDER BY (field1 / field2)
Regards,
Murray
---
"Lost in thought..."
http://www.planetthoughtful.org