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

Answer Posted / haritharavi

Order by clause is used to sort the rows in ascending or
descending order.Group by clause is used to sort/group a
number of rows together so as to apply aggregate functions.
So order by is only to sort the records where as group by
is to sort and find aggregate functions of each group.

Is This Answer Correct ?    32 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is datadir?

482


Is mysql a relational database?

442


How to Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.

539


What is view? How can you create and drop view in mysql?

489


How many types of indexes are there in mysql?

484






Is pdo faster than mysqli?

475


What is difference between mysql and mysqli?

487


What is join in mysql? What are the different types of join?

514


How to dump one database for backup.

501


What is delimiter in mysql?

483


How to include character strings in sql statements?

471


What is general log in mysql?

464


What is the use of mysqli_query?

459


What is definer in mysql trigger?

498


How do you use auto increment?

516