From d42cb9485184d1a76127bfd802d8500f3fa5aba1 Mon Sep 17 00:00:00 2001 From: Alexander Petros Date: Wed, 12 Jul 2023 19:43:52 -0400 Subject: [PATCH] Add date to trip stats output --- .../{trip-stats-to-csq.sql => trip-stats-to-csv.sql} | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) rename db/queries/{trip-stats-to-csq.sql => trip-stats-to-csv.sql} (65%) diff --git a/db/queries/trip-stats-to-csq.sql b/db/queries/trip-stats-to-csv.sql similarity index 65% rename from db/queries/trip-stats-to-csq.sql rename to db/queries/trip-stats-to-csv.sql index 4b53c0f..2941939 100644 --- a/db/queries/trip-stats-to-csq.sql +++ b/db/queries/trip-stats-to-csv.sql @@ -5,7 +5,12 @@ with trip_stats as ( from trip_members group by trip ) -select title, member_count, clubs.name as club +select + trips.id, + title, + member_count, + clubs.name as club, + date(start_time / 1000, 'unixepoch') as date from trips left join clubs on trips.club = clubs.id left join trip_stats on trips.id = trip_stats.trip