Changes between Version 14 and Version 15 of AdvancedDatabaseReports


Ignore:
Timestamp:
01/29/23 19:27:08 (22 months ago)
Author:
181085
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedDatabaseReports

    v14 v15  
    2525
    2626{{{#!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,
     27SELECT 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,
    2828SUM(p.total_sum_payed) as total_money_made, COUNT(DISTINCT de.request_id) as number_of_different_requests,
    2929COUNT(DISTINCT r.passenger_id) as number_of_different_passengers, (SUM(p.total_sum_payed))/COUNT(DISTINCT de.request_id) as average_money_per_request,
     
    3535JOIN payment p ON de.drive_id = p.drive_id
    3636LEFT JOIN request r ON de.request_id = r.request_id
    37 GROUP BY dr.driver_id, dr.email, c.make, c.model
     37GROUP BY dr.driver_id, dr.email, dr.first_name, dr.surname, c.make, c.model
    3838ORDER BY driver_grade DESC
    3939}}}