Answers:
Group by is used to group set of values based on one or more values. Order by is to sort values either in ascending or descending order
groupby is always used with having clause whereas we do not use having clause with orderby.
Posted by: sumit bahuguna
Contact sumit bahuguna
groupby is used when we are using aggregate functions in the query but,orderby is not.
Posted by: sivaranjani
Contact sivaranjani
Not always need aggregator function to use group by. Its can be used to find the distinct values also. Select emp_first_name, emp_last_name from emp group by emp_first_name, emp_last_name Did anybody experienced a situation where they had to use group by instead of DISTINCE?
Posted by: Suresh
Contact Suresh
Group by clause used with group function in query, group by clause used for grouping the data. Order by clause used only for data ordering (ascending or descending).
Posted by: Javaid Hussain
Contact Javaid Hussain
The Simplest answer is Order by :just sorts a column data. Group by : Groups it by similar data. Used for aggregation. Order by could be used inside the Grouped Items
Posted by: OraclePassport.com
Contact OraclePassport.com
as order by sort the data so it can apply to a single field.but group by can be applied only when there are two or more than two fields.
Posted by: Reet Khanna
Contact Reet Khanna
groupby is used to retrieve the data in "GROUP" where as orderby is used to set the order of the records either in "ascending" Or "Descending"
Posted by: Vijay Dixit
Contact Vijay Dixit
Order by keyword is used to sort the result set in asc & desc order. Group by keyword is used to group the resultset. It is used to find distinct values also.
Posted by: prajakta pawar
Contact prajakta pawar
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
There should not be any Spelling Mistakes.
There should not be any Gramatical Errors.
Answers must not contain any bad words.
Answers should not be the repeat of same answer, already approved.
Answer should be complete in itself.