The GROUP BY used to group the related rows together based on the column value(column on which group by is applied).
After GROUP BY, WHERE command is not used to put restriction for doing this HAVING clause is used.
It is used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result set by one or more columns.
SELECT column1,column2 FROM tablename WHERE condition GROUP BY column1
SELECT * FROM students GROUP BY student_city HAVING COUNT(*)>1;