Compare commits

..

No commits in common. "d731f97169e0b601e77f84b42c473f7744c7d54e" and "808cdbaddc273dc7bc7d553f71c6eb1ebf486466" have entirely different histories.

View File

@ -66,14 +66,9 @@ SELECT CAST(SUM(l.distance_in_km) AS INTEGER) AS rowed_km
FROM user u FROM user u
INNER JOIN rower r ON u.id = r.rower_id INNER JOIN rower r ON u.id = r.rower_id
INNER JOIN logbook l ON r.logbook_id = l.id INNER JOIN logbook l ON r.logbook_id = l.id
WHERE u.id NOT IN ( INNER JOIN user_role ur ON u.id = ur.user_id
SELECT ur.user_id INNER JOIN role ro ON ur.role_id = ro.id
FROM user_role ur WHERE ro.name = 'scheckbuch' AND l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%';
INNER JOIN role ro ON ur.role_id = ro.id
WHERE ro.name = 'Donau Linz'
)
AND l.distance_in_km IS NOT NULL
AND l.arrival LIKE '{year}-%';
" "
)) ))
.fetch_one(db) .fetch_one(db)
@ -98,10 +93,10 @@ AND l.arrival LIKE '{year}-%';
SELECT u.name, CAST(SUM(l.distance_in_km) AS INTEGER) AS rowed_km SELECT u.name, CAST(SUM(l.distance_in_km) AS INTEGER) AS rowed_km
FROM ( FROM (
SELECT * FROM user SELECT * FROM user
WHERE id IN ( WHERE id NOT IN (
SELECT user_id FROM user_role SELECT user_id FROM user_role
JOIN role ON user_role.role_id = role.id JOIN role ON user_role.role_id = role.id
WHERE role.name = 'Donau Linz' WHERE role.name = 'scheckbuch'
) )
) u ) u
INNER JOIN rower r ON u.id = r.rower_id INNER JOIN rower r ON u.id = r.rower_id