Interviews5 answers
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
5 Answers
http://www.essentialsql.com/what-is-the-difference-between-group-by-and-order-by/
Munesh SharmaPosted Jun 19, 2015, 8:27 AM EDT
Order By is used for sorting of data either in ascending order or in descending order
where
Group By is used for combining the value of unique combination .Group by used when any aggregate function is used in query..
Rahul PrajapatPosted May 30, 2015, 6:00 AM EDT
Order By is used for sorting of data either in ascending order or in descending order
where
Group By is used for combining the value of unique combination .Group by used when any aggregate function is used in query..
Pankaj Kumar ChoudharyPosted May 21, 2015, 8:23 AM EDT
On the surface both clauses appear to do the same thing, that is sort data. But this is where their similarities end. Both serve entirely different purposes.
-> ORDER BY clause's purpose is to sort the query result by specific columns.
-> GROUP BY clause's purpose is summarize unique combinations of columns values.
Nirav VasoyaPosted Apr 21, 2015, 3:08 AM EDT
ORDER BY alters the order in which items are returned.
GROUP BY will aggregate records by the specified columns which allows you to perform aggregation functions on non-grouped columns (such as SUM, COUNT, AVG, etc)
GROUP BY will aggregate records by the specified columns which allows you to perform aggregation functions on non-grouped columns (such as SUM, COUNT, AVG, etc)
Sathish DVPosted Apr 6, 2011, 12:46 AM EDT





