Appinventiv interview question

1. Group by VS order by main Difference ?

Interview Answers

Anonymous

20 Jun 2019

group by is for grouping same rows and order by is for sorting

Anonymous

10 Jan 2019

Group By Vs Order By 1. Group By :- It is used to group our result sets of tables in database and is often used with Count, sum, avg etc. Eg:- SELECT COUNT(state), country FROM tblcountry GROUP BY country 2. Order by :- it changes only order in our result set i.e sorting SELECT COUNT(state), country FROM tblcountry ORDER BY country_id