Lets say there was a dataset like this
Grp | Name (Unique)
A | Joe
B | Bob
C | Jill
B | James
If there were about 50 of each group (A,B,C) how do I return a result with only the top 5 from each group without doing something like this
SELECT TOP 5 * FROM TABLE WHERE Grp = 'A' UNION ALL
SELECT TOP 5 * FROM TABLE WHERE Grp = 'B' UNION ALL
SELECT TOP 5 * FROM TABLE WHERE Grp = 'C'