attipa
asked on
doing math in a stored procedure
I have a table called PGRating. I want to be able to add the values in the Rating column all together and then take an average of that. in plain english, here is the formula:
select (Sum of all Rating values) / (count of rows)
from PGRating
where PGImageID = @PGImageID
select (Sum of all Rating values) / (count of rows)
from PGRating
where PGImageID = @PGImageID
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(Select Count(1) From PGRating)
From PRGRating
Where PGImageID = @PGImageID