Compare commits
No commits in common. "d3bc2bea4ffa7cc2934dece63488725686420825" and "7c8f20623c1411dd3ab6cdaffc68fda8fbfacf4e" have entirely different histories.
d3bc2bea4f
...
7c8f20623c
@ -27,22 +27,22 @@ impl BoatStat {
|
|||||||
|
|
||||||
let rows = sqlx::query(
|
let rows = sqlx::query(
|
||||||
"
|
"
|
||||||
SELECT
|
SELECT
|
||||||
boat.id,
|
boat.id,
|
||||||
location.name AS location,
|
location.name AS location,
|
||||||
CAST(strftime('%Y', arrival) AS INTEGER) AS year,
|
CAST(strftime('%Y', arrival) AS INTEGER) AS year,
|
||||||
CAST(SUM(COALESCE(distance_in_km, 0)) AS INTEGER) AS rowed_km
|
CAST(SUM(distance_in_km) AS INTEGER) AS rowed_km
|
||||||
FROM
|
FROM
|
||||||
boat
|
logbook
|
||||||
LEFT JOIN
|
INNER JOIN
|
||||||
logbook ON boat.id = logbook.boat_id AND logbook.arrival IS NOT NULL
|
boat ON boat.id = logbook.boat_id
|
||||||
LEFT JOIN
|
INNER JOIN
|
||||||
location ON boat.location_id = location.id
|
location ON boat.location_id = location.id
|
||||||
WHERE
|
WHERE
|
||||||
boat.name != 'Externes Boot'
|
boat.name != 'Externes Boot'
|
||||||
GROUP BY
|
GROUP BY
|
||||||
boat.id, year
|
boat_id, year
|
||||||
ORDER BY
|
ORDER BY
|
||||||
boat.name, year DESC;
|
boat.name, year DESC;
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user