A common business requirement is to fetch the top N rows of each group, for example, largest cities for each country. Unfortunately many solutions utilize non-MySQL vendor-specific functions. Rob Gravelle covers a couple of approaches that will work with MySQL.
↧