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

Answer Posted / zaid manzoor

The ORDER BY keyword is used to sort the result-set.
The ORDER BY Keyword

The ORDER BY keyword is used to sort the result-set by a specified column.

The ORDER BY keyword sort the records in ascending order by default.

If you want to sort the records in a descending order, you can use the DESC keyword.

SQL ORDER BY Syntax
Aggregate functions often need an added GROUP BY statement.
The GROUP BY Statement
The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns.

Is This Answer Correct ?    19 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi Team, This is kartik, I recently completed my B-tech. Importance of posting this question is for to know the best books on SQL(MYSQL/Oracle)? I like SQL concept's so much, at the same time i decided to choose SQL for my career purpose. So please suggest me the best books that are very helpful for a fresher to improve concepts like (SQL/PLSQL)Basics, programming concepts, architectures etc. Please consider my request as an important one. I am very thankful to you for providing this opportunity. If possible can you please send the names of books for my personal id also: karthikgdv1206@yahoo.com. Thanks, Kartik T

1735


What is trigger in mysql?

484


Can you tell the reasons for selecting lamp(linux, apache, mysql, php) instead of any other combination of software programs, servers, and operating system?

454


Write a query to fetch common records between two tables using mysql?

530


How do I stop a query in mysql workbench?

475






What does innodb stand for?

521


Can you tell the difference between mysql_fetch_object and mysql_fetch_array?

497


What is a mysql model?

495


What is mysql server?

478


What is horizontally scalable?

504


What is the difference between a heap table and temporary table?

495


How you will Show unique records.

537


How to insert dynamic values in mysql using php?

533


Can we write pl sql mysql?

496


Which storage engine is best in mysql?

468