0
What is use of group by?
difference between that and order by
1 Answer
+ 1
Group by helps you to group the output with any particular attribute
while order by helps you to order the output according to given attribute
for example: if you have 4employees with their respective salaries in CSE dept
then "select deptid, SUM(salary) AS salaries from dept group by deptid" returns the combined salaries of all the 4employees in CSE dept.
"Order by deptid" returns the salaries of employees in ascending of their id's.