Switch to full style
Include SQL commands
Post a reply

SQL GROUP BY Command

Sun Jul 15, 2012 11:02 pm

GROUP BY command will create a group by a specific column and will count the records in each group as follows :


Code:
SELECT count(*) as total_records, class FROM 'Department' group by type



You can also add where clause to the this type of queries as follows :

Code:

SELECT count
( * ) AS total_records, class FROM 'Department' WHERE NumOfStudents>100 GROUP BY type




Post a reply
  Related Posts  to : SQL GROUP BY Command
 Cannot Delete Computer group     -  
 SELECT-Group by and Order by,Having Clause,count(),Joins     -  
 The New Indian Express Group Bangalore : Electrical Engineer     -  
 BETWEEN SQL COMMAND     -  
 Average SQL command     -  
 JVM does not recognize MQ command.     -  
 Calling the man Command     -  
 SQL COUNT Command     -  
 SQL LOCATE command     -  
 SQL LIKE query Command     -