Code Monkey home page Code Monkey logo

Comments (5)

epeeme avatar epeeme commented on June 1, 2024

Get events;

SELECT events.ID,eventName, CAST(AVG(entries) AS Integer), CAST(AVG(eventPosition) AS Integer), CAST((100/(AVG(entries))*AVG(eventPosition)) AS Integer)
FROM events
LEFT OUTER JOIN eventData ON eventData.eventID = events.ID
LEFT OUTER JOIN results ON results.eventID = events.ID
WHERE eventType = 'EFC' AND catID = 6AND fencerClubID = 415
GROUP BY eventName
ORDER BY CAST((100/(AVG(entries))*AVG(eventPosition)) AS Integer) ASC

from web.

epeeme avatar epeeme commented on June 1, 2024
SELECT 
SUM(CASE WHEN eventPosition = 1 THEN 1 ELSE 0 END) AS first, 
SUM(CASE WHEN eventPosition = 2 THEN 1 ELSE 0 END) AS second, 
SUM(CASE WHEN eventPosition = 3 THEN 1 ELSE 0 END) AS third, 
SUM(CASE WHEN eventPosition > 3 AND eventPosition < 9 THEN 1 ELSE 0 END) AS last8, 
SUM(CASE WHEN eventPosition > 8 AND eventPosition < 17 THEN 1 ELSE 0 END) AS last16, 
SUM(CASE WHEN eventPosition > 16 AND eventPosition < 33 THEN 1 ELSE 0 END) AS last32, 
SUM(CASE WHEN eventPosition  > 32 AND eventPosition < 65 THEN 1 ELSE 0 END) AS last64, 
SUM(CASE WHEN eventPosition  > 64 AND eventPosition < 129 THEN 1 ELSE 0 END) AS last128, 
SUM(CASE WHEN eventPosition  > 128 AND eventPosition < 257 THEN 1 ELSE 0 END) AS last256, 
SUM(CASE WHEN eventPosition  > 256 AND eventPosition < 513 THEN 1 ELSE 0 END) AS last512
FROM results 
LEFT OUTER JOIN events ON events.ID  = results.eventID 
LEFT OUTER JOIN eventData ON eventData.eventID = results.eventID AND results.dateID = eventData.dateID where eventData.catID=6 AND results.eventCat=6 AND eventType = 'EFC' AND fencerClubID = 415

from web.

epeeme avatar epeeme commented on June 1, 2024

https://epee.me/__old__/euro.php

from web.

epeeme avatar epeeme commented on June 1, 2024

Remove 9999s from average position calculation (Italy, Girls, 2019 or 18 I think it was).

from web.

epeeme avatar epeeme commented on June 1, 2024

Working live at https://epee.me/efcEventHistory.php - a bit sketchy on mobile, but due to the amount of data this is really something for use on devices with bigger screens.

from web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.