What is the difference between GROUP BY and ORDER BY in
Sql?

Answer Posted / hareesha k

GROUP BY is used to group values from a column, and, if
necessary, perform calculations on that column. We can use
aggregation functions (e.g. COUNT, SUM, AVG) on the grouped
column.
The result of the GROUP BY is ordered by the column that
grouped.

The ORDER BY clause is used only for ordering(Sorting) the
query results.Asc by default.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to start and stop mysql on windows? How do I do that?

523


How to use rank function in mysql?

482


What is the function of mysqldump?

578


Is mysqli faster than mysql?

491


How to use sum function in where clause in mysql?

449






Where’s database data actually stored? Is there a way to see the files which are stored?

514


What is a simple query?

472


How to get the number of rows selected or affected by a sql statement?

509


How many columns can a table have?

490


Is mysql workbench a dbms?

534


Explain the architecture models of SQL Server?

1902


List some comparisons operators used in mysql?

535


What are the difference between mongodb and mysql?

658


Explain the difference between mysql_fetch_array(), mysql_fetch_object()?

464


Can you tell few best practices to be followed for optimization in sql?

510