It is used to group the result-set by one or more column. It is used in conjunction with aggregate functions provided by Structured Query Language . If order by is used then Group By must come before Order By clause.
SELECT column1,column2,...,columnN FROM tablename WHERE conditions GROUP BY columnname;
SELECT column1,aggregate-function(columnName) FROM tablename WHERE conditions GROUP BY columnname;
SELECT City, SUM(Salary) FROM Employee GROUP BY City;
The above query will fetch city and sum of salary who are grouped by city. It means that sum of salaries will be city wise.