-
-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request : logbook query to shows hours by aircraft #1026
Comments
Makes sense since the other queries cannot be sorted by traveling time. |
Fixed (and much more) with 5dcb3ba |
I wish I had thought of it sooner, but it is trivial to also include count of flights per aircraft in the same query. SELECT aircraft_name, aircraft_type, SUM(hours_flown) as total_hours, COUNT(*) AS total_flights |
No problem. Still fixing small bugs here and there anyway. 🙂 |
I promise, this is the last one, but this occurred to me tonight and seems very nice to have, last_flight and first_flight per aircraft. SELECT aircraft_name, aircraft_type, SUM(hours_flown) as total_hours, COUNT(*) AS total_flights, MAX(departure_time) AS last_flight, MIN(departure_time) AS first_flight |
maybe avg_flt_hours is also interesting.. SELECT aircraft_name, aircraft_type, SUM(hours_flown) as total_hours, COUNT(*) AS total_flights, AVG(hours_flown) as avg_flt_hours, MAX(departure_time) AS last_flight, MIN(departure_time) AS first_flight |
total_distance and avg_distance are also easy to include SELECT aircraft_name, aircraft_type, |
Good I made the stats code more flexible. 🙂 |
I would like to see a new logbook query to show me how many hours I have in each aircraft.
I was able to write a query for it using external sqlite gui, but wish it could be built in.
SELECT
aircraft_name,
aircraft_type,
SUM(hours_flown) as total_hours
FROM
(
select
logbook_id,
aircraft_name,
aircraft_type,
CAST ((julianday(destination_time) - julianday(departure_time)) * 24 AS REAL) AS hours_flown
from logbook
WHERE
departure_time IS NOT NULL
AND destination_time IS NOT NULL
)
GROUP BY
aircraft_name,
aircraft_type
ORDER BY total_hours DESC
;
The text was updated successfully, but these errors were encountered: