In: Computer Science
We use grouping in queries to collect the rows having similar data.
Grouping is done in queries with the help of the Group By clause.
We have to specify the name of the coloum with group by clause to identify that coloum similar data.
Synatx:
SELECT statements... GROUP BY column_name1[,column_name2,...]
I am uploading some images by them you can easily understand the grouping concept with example.
There are some major points that needs to remember for grouping
GROUP BY clause is used with the SELECT statement.
GROUP BY clause is always written after WHERE clause.
GROUP BY clause is always written before ORDER BY clauseif order by is used.
Still if you are having any doubt feel free to ask.