MySql AVG issue - Does AVG gives exact calculation in float? -
my sql query looks this:
select m.original_name, m.type, m.title, m.views, m.description, m.hash, avg(mr.rating_scale5) avg_rating_scale5 c7_media m, c7_media_ratings mr m.public=1 , m.hash = mr.media_hash group mr.media_hash
here taking average of mr.rating_sacle5 grouped mr.media_hash
i want ask 1 thing, avg gives float value: suppose if takes avg of (5+4+4)/3. because me not giving exact calculation.
if run same query using sum, instead of avg, different out puts.
or can using sum(mr.rating_scale5)/count()
dont know how should count every different file? if think avg not solve purpose plz let me know how should count in sum(mr.rating_scale5)/count()
.
Comments
Post a Comment