Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: page to show most clinched segments/routes/connected routes #791

Open
jteresco opened this issue Aug 11, 2024 · 1 comment
Open

Comments

@jteresco
Copy link
Contributor

In this AARoads post the top routes clinched by the most travelers was computed and listed. This could be a page where the global stats can be shown, then restricted by system, region, country, etc.

@jteresco
Copy link
Contributor Author

Some queries used (thanks for the assists, ChatGPT) to get the tables posted in the AARoads thread.

SELECT route, COUNT(*) AS clinched_count FROM clinchedRoutes WHERE clinched = 1 GROUP BY route ORDER BY clinched_count DESC LIMIT 1;

SELECT cr.route, COUNT(*) AS clinched_count FROM clinchedRoutes cr JOIN listEntries le ON cr.traveler = le.traveler WHERE cr.clinched = 1 AND le.includeInRanks = 1 GROUP BY cr.route ORDER BY clinched_count DESC;

SELECT cr.route, COUNT(*) AS clinched_count, RANK() OVER (ORDER BY COUNT(*) DESC) AS rank FROM clinchedRoutes cr JOIN listEntries le ON cr.traveler = le.traveler JOIN routes r ON cr.route = r.root WHERE cr.clinched = 1 AND le.includeInRanks = 1 AND r.systemName != 'usai' GROUP BY cr.route ORDER BY clinched_count DESC;

SELECT cr.route, COUNT(*) AS clinched_count, RANK() OVER (ORDER BY COUNT(*) DESC) AS rank FROM clinchedRoutes cr JOIN listEntries le ON cr.traveler = le.traveler JOIN routes r ON cr.route = r.root JOIN regions reg ON r.region = reg.code WHERE cr.clinched = 1 AND le.includeInRanks = 1 AND r.systemName != 'usai' AND reg.country != 'USA' GROUP BY cr.route ORDER BY clinched_count DESC;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant