visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: General :: mean of a database data


By: Squibi U.S.A.  Date: 09/10/2002 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
Tell me how to get a mean of a database
By: Squibi Date: 09/10/2002 23:10:00 English  Type : Comment
I want to calculate average from  database field

By: VGR Date: 09/10/2002 23:25:00 English  Type : Comment
select mean(column_name) as a from table_name where 1;

it all depends which RDBMS you have

If it's mySQL, then the above is not working because there is no MEAN() function. Emulate it like this :
select sum(col_name)/count(*) as a from table_name;
By: VGR Date: 09/10/2002 23:29:00 English  Type : Answer
sorry, apparently the MEAN function exists on mySQL but is called AVG() ;-)

AVG(expr)
Returns the average value of expr:


Do register to be able to answer

EContact
browser fav
page generated in 297.993900 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page