Changes between Version 13 and Version 14 of AdvancedDatabaseReports


Ignore:
Timestamp:
01/29/23 18:57:00 (22 months ago)
Author:
181085
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedDatabaseReports

    v13 v14  
    1313
    1414{{{#!sql:
    15 SELECT d.driver_id, SUM(d.km_travelled) as km_travelled_with_driver,
     15SELECT uuid_generate_v4() as id, pay.passenger_id, d.driver_id, SUM(d.km_travelled) as km_travelled_with_driver,
    1616SUM(pay.total_sum_payed) as total_price_paid, SUM(pay.total_sum_payed)/SUM(d.km_travelled) as price_per_km
    1717FROM request r
    1818JOIN drive d ON r.request_id = d.request_id
    19 JOIN payment pay ON pay.passenger_id = r.passenger_id
    20 WHERE r.passenger_id = '87da7c89-fc2e-44a0-9bfa-d89de68c2a22'
    21 GROUP BY d.driver_id
    22 ORDER BY price_per_km ASC
     19JOIN payment pay ON d.drive_id = pay.drive_id
     20GROUP BY d.driver_id, pay.passenger_id
     21ORDER BY price_per_km asc
    2322}}}
    2423