InterviewSolution
| 1. |
What Is The Difference Between Group By And Order By In Sql? |
|
Answer» To sort a result, use an ORDER BY clause. GROUP BY [col1],[col2],...[coln]; Tells DBMS to group (aggregate) RESULTS with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all VALUES or view AVERAGE. To sort a result, use an ORDER BY clause. GROUP BY [col1],[col2],...[coln]; Tells DBMS to group (aggregate) results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average. |
|