Changes between Version 14 and Version 15 of AdvancedDatabaseReports
- Timestamp:
- 01/29/23 19:27:08 (22 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedDatabaseReports
v14 v15 25 25 26 26 {{{#!sql: 27 SELECT dr.driver_id, dr.email, c.make, c.model, (CASE WHEN num_grades > 2 THEN AVG(de.grade) ELSE NULL END) as driver_grade, COUNT(*) as number_of_drives,27 SELECT uuid_generate_v4() as id, dr.driver_id, dr.email, dr.first_name as driver_name, dr.surname as driver_surname, c.make, c.model, (CASE WHEN num_grades > 2 THEN AVG(de.grade) ELSE NULL END) as driver_grade, COUNT(*) as number_of_drives, 28 28 SUM(p.total_sum_payed) as total_money_made, COUNT(DISTINCT de.request_id) as number_of_different_requests, 29 29 COUNT(DISTINCT r.passenger_id) as number_of_different_passengers, (SUM(p.total_sum_payed))/COUNT(DISTINCT de.request_id) as average_money_per_request, … … 35 35 JOIN payment p ON de.drive_id = p.drive_id 36 36 LEFT JOIN request r ON de.request_id = r.request_id 37 GROUP BY dr.driver_id, dr.email, c.make, c.model37 GROUP BY dr.driver_id, dr.email, dr.first_name, dr.surname, c.make, c.model 38 38 ORDER BY driver_grade DESC 39 39 }}}