Problem Description
I've seen some overly-complicated variations on this question, and none with a good answer. I've tried to put together the simplest possible example:
Given a table like that below, with person, group, and age columns, how would you get the oldest person in each group? (A tie within a group should give the first alphabetical result)
|Person | Group | Age|
|-------|-------|----|
|Bob | 1 | 32 |
|Jill | 1 | 34 |
|Shawn | 1 | 42 |
|Jake | 2 | 29 |
|Paul | 2 | 36 |
|Laura | 2 | 39 |
Desired result set:
|Person | Group | Age|
|-------|-------|----|
|Shawn | 1 | 42 |
|Laura | 2 | 39 |
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?