Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select t.team_name, e.emp_name
- from teams as t
- join employees as e on t.team_id = e.TEAM_ID
- join (
- select t.team_name, min(e.date_of_birth) as Birth_Date
- from teams as t
- join employees as e on t.team_id = e.TEAM_ID
- group by t.team_id, t.team_name
- ) as N
- where t.team_name = N.team_name and e.date_of_birth = N.Birth_Date
- group by t.team_id, t.team_name, e.emp_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement