js-table #364

Merged
marie merged 23 commits from js-table into staging 2024-04-14 17:56:45 +02:00
Showing only changes of commit d3bc2bea4f - Show all commits

View File

@ -31,17 +31,17 @@ impl BoatStat {
boat.id,
location.name AS location,
CAST(strftime('%Y', arrival) AS INTEGER) AS year,
CAST(SUM(distance_in_km) AS INTEGER) AS rowed_km
CAST(SUM(COALESCE(distance_in_km, 0)) AS INTEGER) AS rowed_km
FROM
logbook
INNER JOIN
boat ON boat.id = logbook.boat_id
INNER JOIN
boat
LEFT JOIN
logbook ON boat.id = logbook.boat_id AND logbook.arrival IS NOT NULL
LEFT JOIN
location ON boat.location_id = location.id
WHERE
boat.name != 'Externes Boot'
GROUP BY
boat_id, year
boat.id, year
ORDER BY
boat.name, year DESC;
",