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

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -