International-Aerobatic-Club / iaccdb

IAC Aerobatic Contest Database
iaccdb.iac.org
1 stars 1 forks source link

Add Chief Judges to the 'Leaders' menu #228

Closed djmolny closed 1 year ago

djmolny commented 2 years ago

Display the number of contests, total flights, and flights by category for everyone who served as a Chief Judge in the selected year.

djmolny commented 2 years ago

Here's a query that counts flights per Chief for a given time period:

SELECT family_name, given_name, count(*) AS c
  FROM members, flights, pilot_flights, contests
  WHERE chief_id = members.id AND flight_id = flights.id
    AND contest_id = contests.id
    AND start >= '2017-01-01'
    AND start <= '2017-12-31'
 GROUP BY members.id
 ORDER BY c DESC