Code Monkey home page Code Monkey logo

Comments (3)

epeeme avatar epeeme commented on June 1, 2024
SELECT eventData.eventID, eventName, 
SUM(CASE WHEN year = 2018 AND catID = 25 THEN entries ELSE 0 END),
SUM(CASE WHEN year = 2018 AND catID = 26 THEN entries ELSE 0 END),
SUM(CASE WHEN year = 2019 AND catID = 25 THEN entries ELSE 0 END),
SUM(CASE WHEN year = 2019 AND catID = 26 THEN entries ELSE 0 END)
FROM eventData
INNER JOIN eventDates ON eventDates.ID = dateID
INNER JOIN events ON events.ID = eventData.eventID
WHERE (catID= 25 OR catID= 26) AND (year = 2018 or year = 2019)
GROUP BY eventData.eventID

from web.

epeeme avatar epeeme commented on June 1, 2024

Unrelated, but dumping here;

SELECT clubName, count(*)
FROM results
INNER JOIN eventData ON eventData.eventID = results.eventID AND eventData.dateID = results.dateID
INNER JOIN eventDates ON eventDates.ID = results.dateID
INNER JOIN events ON events.ID = eventData.eventID
INNER JOIN clubs ON clubs.ID = fencerClubID
WHERE year = 2019 AND cty = 0 AND sch = 0 AND uni = 0 AND region = 0
GROUP BY clubName
ORDER BY count(*) DESC

from web.

epeeme avatar epeeme commented on June 1, 2024

SELECT clubName, count()
FROM results
INNER JOIN eventData ON eventData.eventID = results.eventID AND eventData.dateID = results.dateID AND eventData.catID = results.eventCat
INNER JOIN eventDates ON eventDates.ID = results.dateID
INNER JOIN events ON events.ID = eventData.eventID
INNER JOIN clubs ON clubs.ID = fencerClubID
WHERE year = 2019 AND cty = 0 AND sch = 0 AND uni = 0 AND region = 0 AND results.eventCat IN (10,11,8,15,3,17,5,13,9,12,7,16,4,18,1,14)
GROUP BY clubName
ORDER BY count(
) DESC

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.