0

I have this question: Show the top 5 game Disciplines for the countries who got more than 10 gold medals.

my code is: select distinct t.discipline, m.team from teams t join medals m on (t.noc=m.team and m.numbergold>10) order by m.team;

cloud you please help me with this code to show the top 5 game for each country?

change the code to display 5 games for each country

enter image description here

Chris Albert
  • 2,462
  • 8
  • 27
  • 31
head
  • 1
  • 1

1 Answers1

0

Please use the group by and windows function for your required result. In 'numbergold' - Use windows functions like dense_rank so that you can filter on the top 5.

Ankur
  • 1
  • 3
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 22 '22 at 12:22