Gossamer Forum
Home : General : Databases and SQL :

MYSQL Sorting by a calculated variable

Quote Reply
MYSQL Sorting by a calculated variable
Hello.

Is it possibly to sort a query using a calculated variable? Let's say I have a table with the following fields. Name, Number1, Number2. What if I want to display all 'Name' values sorted by Number1 + Number2 (sorted by their sum) or perhaps Number2 / Number1. Is that possible? And how would I do that?

Thanks,
- shazow
Subject Author Views Date
Thread MYSQL Sorting by a calculated variable shazow 5390 Oct 24, 2002, 8:06 AM
Thread Re: [shazow] MYSQL Sorting by a calculated variable
604 5241 Oct 24, 2002, 10:56 AM
Post Re: [TheStone] MYSQL Sorting by a calculated variable
shazow 5121 Oct 24, 2002, 3:27 PM