Results 1 to 2 of 2
Mar 8, 2002, 13:51 #1
- Join Date
- Jan 2001
- Jersey City, NJ
- 0 Post(s)
- 0 Thread(s)
[HDI] Do Math In A Query Statement Using MYSQL?
I want to do a SELECT on a table that has two fields, however I'd like to do a calcuation in the query for it. I lost all my good SQL bookmarks and was hoping someone knew this offhand.
The two fields are rating and usercount. I would have to divide 'rating' by the 'usercount' to get the 'average' and then I'd like to ORDER BY the average is DESC.
I hope I wrote this out properly...<///////~
Mar 8, 2002, 14:19 #2Code:
SELECT [...],(rating/usercount) AS average FROM tblName ORDER BY average DESC;