Skip to content

Instantly share code, notes, and snippets.

@gunnarig
Created February 13, 2019 23:56
Show Gist options
  • Save gunnarig/01a077852735846dec36824ece847f4c to your computer and use it in GitHub Desktop.
Save gunnarig/01a077852735846dec36824ece847f4c to your computer and use it in GitHub Desktop.
select distinct people.id as peopleID, people.name from people where id in
(select distinct peopleid from results where competitionid in
(select id from competitions where held >= '2002-06-01'::date and held < '2002-07-01'::date))
or id in (select distinct peopleid from results where sportid = (select id from sports where name = 'High Jump')
and result = (select record from sports where name = 'High Jump')) order by people.name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment