
August 25th, 2002, 12:36 PM
|
|
Registered User
|
|
Join Date: Jun 2002
Posts: 11
Time spent in forums: 1 h 55 m 6 sec
Reputation Power: 0
|
|
|
Division in a MySQL query?
I have two rating fields in my table. rate_total holds the total sum of all submitted ratings and rate_count holds the number of times this row has been rated.
so if one person submits a rating of 4, rate_total = 4 and rate_count = 1
if someone esle submits a rating of 3, rate_total = 7 and rate_count = 2
is it possible to divide rate_total by rate_count in my SELECT query and return the row with the highest result? or do i need to create a third field, rate_result, and update that with the quotient everytime someone submits a rating?
|