The difference between group by and order by in mysql is as follow: 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). Read More »
You are here: Home >> Tag Archives: group by
Tag Archives: group by
Feed SubscriptionDifference between distinct and group by in mysql
The difference between DISTINCT and GROUP BY in Mysql is that they usually generate the same query plan, so performance should be the same across both query constructs. GROUP BY should be used to apply aggregate operators to each group. If all you need is to remove duplicates then use DISTINCT. If you are using sub-queries execution plan for that ... Read More »