Databases :: General :: mean of a database data |
|||
| By: Squibi |
Date: 09/10/2002 00:00:00 |
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 | Type : Comment |
|
| I want to calculate average from database field |
|||
| By: VGR | Date: 09/10/2002 23:25:00 | 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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








