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
What are numeric data types?
What is the difference between heap table and temporary table?
How internally data stores in MyISAM and INNODB table types?
What is a procedure example?
How to change a password for an existing user via mysqladmin?
Suppose you have to collect the first name, middle name and the last name of students from the below table. But, you observe that there few missing values either in the first name, middle name and the last name columns. How will you return the first non-null values?
What is the data type for file in mysql?
How to allow the user "sonia" to connect to the server from localhost using the password "passwd". Login as root. Switch to the mysql db. Give privs. Update privs.
How we get sum of column.
What is row?
How do I insert an image into mysql workbench?
What is the use of mysqli_connect in php?
Where is mysql data stored linux?
What are views in mysql?
Is null in mysql?