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
How do stored procedures work?
What is difference between mongodb and mysql?
Can you tell few best practices to be followed for optimization in sql?
What is a mysql server?
How can we get total number of records by query in mysql?
What are the method you will follow while sql installing
What is mysqli procedural?
What is the latest mysql?
What is the latest version of php and mysql?
Why mysql is open source?
Can foreign key have duplicate values?
What is a procedure example?
What are programming functions?
What is query design?
Can a table have multiple primary keys?