Switch to full style
Include SQL commands
Post a reply

Average SQL command

Sun Jul 15, 2012 12:54 am

Average SQL command examples, imagine that we have a table with four columns ID, NAME, CLASS, and MARK, and we want to get the average for all students' marks:


Code:

SELECT avg
mark FROM 'student'
 


You can also name the header us "as" :
Code:

SELECT AVG
(mark) as avg_mark FROM 'student'
 


You can also get average for specific groups :

Code:

SELECT 
class, avgmark ) as avg_mark FROM `studentGROUP BY class
 




Post a reply
  Related Posts  to : Average SQL command
 C++ Average example     -  
 Average of an array. Please help     -  
 BETWEEN SQL COMMAND     -  
 SQL COUNT Command     -  
 JVM does not recognize MQ command.     -  
 Calling the man Command     -  
 SQL LIKE query Command     -  
 SQL LOCATE command     -  
 SQL GROUP BY Command     -  
 SQL ALTER Command     -