Get top n records for each group of grouped results Get top n records for each group of grouped results sql sql